git: kernel - Fix pager bug in vm_fault and UFS and have UFS use vop_stdgetpages

Matthew Dillon dillon at
Mon Jan 18 10:09:17 PST 2010

commit 1c9602b3f188939350673789fd763f1c4c8251b6
Author: Matthew Dillon <dillon at>
Date:   Mon Jan 18 09:57:51 2010 -0800

    kernel - Fix pager bug in vm_fault and UFS and have UFS use vop_stdgetpages
    * UFS must call vtruncbuf() before b*write()ing the buffer related to
      a shortened file's truncation point.  vtruncbuf() can invalidate pages
      which are part of the buffer cache buffer.  The b*write() revalidates
      those pages.  If we fail to revalidate the pages we can end up with a
      buffer containing invalid pages with B_CACHE set.
    * UFS was using its own getpages code in certain cases.  Adjust it to
      use vop_stdgetpages() in all cases by default.
      vop_stdgetpages() uses UIO_NOCOPY VOP_READ()s to fill in missing data
      and to perform read-ahead operations.  It should properly deal with
      partially valid and partially dirty pages as well as deal with file
    * vm_fault can pass a valid page to the readrest: code if PG_RAM is set.
      We cannot free this page if the underlying vnode contains a hole at
      that location.  Call vm_pager_get_page() unconditionally.
      This fixes fsx failures for both NFS and UFS (when UFS is using

Summary of changes:
 sys/vfs/hammer/hammer_vnops.c |   11 +++++++++++
 sys/vfs/ufs/ffs_alloc.c       |    1 +
 sys/vfs/ufs/ffs_balloc.c      |   16 ++++++++++++----
 sys/vfs/ufs/ffs_inode.c       |   20 +++++++++++++++-----
 sys/vfs/ufs/ffs_subr.c        |    3 ++-
 sys/vfs/ufs/ufs_readwrite.c   |   34 ++++++++++++++++++++++++----------
 sys/vm/vm_fault.c             |   21 ++++++++++++---------
 sys/vm/vm_object.c            |    5 +++++
 8 files changed, 82 insertions(+), 29 deletions(-)

DragonFly BSD source repository

More information about the Commits mailing list