about summary refs log tree commit diff
path: root/nscd/pwdcache.c
diff options
context:
space:
mode:
Diffstat (limited to 'nscd/pwdcache.c')
-rw-r--r--nscd/pwdcache.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/nscd/pwdcache.c b/nscd/pwdcache.c
index b3227785ae..2354b6d78a 100644
--- a/nscd/pwdcache.c
+++ b/nscd/pwdcache.c
@@ -287,8 +287,13 @@ cache_addpw (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);