Author: kib
Date: Fri Feb  2 11:56:30 2018
New Revision: 328773
URL: https://svnweb.freebsd.org/changeset/base/328773

Log:
  On pageout, in vnode generic pager, for partially dirty page, only
  clear dirty bits for completely invalid blocks.
  
  Otherwise we might not write out the last chunk that is shorter than
  512 bytes, if the file end is not aligned on disk block boundary.
  This become important after the r324794.
  
  PR:   225586
  Reported by:  tris_v...@hotmail.com
  Tested by:    pho
  Sponsored by: The FreeBSD Foundation
  MFC after:    3 days

Modified:
  head/sys/vm/vnode_pager.c

Modified: head/sys/vm/vnode_pager.c
==============================================================================
--- head/sys/vm/vnode_pager.c   Fri Feb  2 07:55:31 2018        (r328772)
+++ head/sys/vm/vnode_pager.c   Fri Feb  2 11:56:30 2018        (r328773)
@@ -1266,6 +1266,8 @@ vnode_pager_generic_putpages(struct vnode *vp, vm_page
                        maxsize = object->un_pager.vnp.vnp_size - poffset;
                        ncount = btoc(maxsize);
                        if ((pgoff = (int)maxsize & PAGE_MASK) != 0) {
+                               pgoff = roundup2(pgoff, DEV_BSIZE);
+
                                /*
                                 * If the object is locked and the following
                                 * conditions hold, then the page's dirty
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to