summaryrefslogtreecommitdiff
path: root/nscd/grpcache.c
diff options
context:
space:
mode:
Diffstat (limited to 'nscd/grpcache.c')
-rw-r--r--nscd/grpcache.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/nscd/grpcache.c b/nscd/grpcache.c
index 7315eece61..d07693f1a4 100644
--- a/nscd/grpcache.c
+++ b/nscd/grpcache.c
@@ -291,8 +291,13 @@ cache_addgr (struct database_dyn *db, int fd, request_header *req,
{
/* If necessary, we also propagate the data to disk. */
if (db->persistent)
- // XXX async OK?
- msync (dataset, total + n, MS_ASYNC);
+ {
+ // XXX async OK?
+ uintptr_t pval = (uintptr_t) dataset & ~pagesize_m1;
+ msync ((void *) pval,
+ ((uintptr_t) dataset & pagesize_m1) + total + n,
+ MS_ASYNC);
+ }
/* Now get the lock to safely insert the records. */
pthread_rwlock_rdlock (&db->lock);