about summary refs log tree commit diff
path: root/nscd/hstcache.c
diff options
context:
space:
mode:
Diffstat (limited to 'nscd/hstcache.c')
-rw-r--r--nscd/hstcache.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/nscd/hstcache.c b/nscd/hstcache.c
index 94568d0d2b..78e29fb3d1 100644
--- a/nscd/hstcache.c
+++ b/nscd/hstcache.c
@@ -332,8 +332,13 @@ cache_addhst (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 + req->key_len, MS_ASYNC);
+	    {
+	      // XXX async OK?
+	      uintptr_t pval = (uintptr_t) dataset & ~pagesize_m1;
+	      msync ((void *) pval,
+		     ((uintptr_t) dataset & pagesize_m1)
+		     + total + req->key_len, MS_ASYNC);
+	    }
 
 	  addr_list_type = (hst->h_length == NS_INADDRSZ
 			    ? GETHOSTBYADDR : GETHOSTBYADDRv6);