DragonFly BSD
DragonFly commits List (threaded) for 2010-01
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

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


From: Matthew Dillon <dillon@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 18 Jan 2010 10:07:59 -0800 (PST)

commit 1c9602b3f188939350673789fd763f1c4c8251b6
Author: Matthew Dillon <dillon@apollo.backplane.com>
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
      holes.
    
    * 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
      vop_stdgetpages()).

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(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/1c9602b3f188939350673789fd763f1c4c8251b6


-- 
DragonFly BSD source repository



[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]