git: kernel - Fix issues where tmpfs loses file data

Matthew Dillon dillon at crater.dragonflybsd.org
Fri Dec 7 14:25:54 PST 2012


commit d86d27a81d75c46fb451b36f43f87b3300c1a260
Author: Matthew Dillon <dillon at apollo.backplane.com>
Date:   Fri Dec 7 14:20:31 2012 -0800

    kernel - Fix issues where tmpfs loses file data
    
    * For TMPFS, UIO_NOCOPY writes must use bawrite() or bwrite() and must NEVER
      used buwrite() because these operations are being called via the VM page
      cleaning code via the pageout daemon or the vnode termination code
      (when maxvnodes is reached), and the underlying pages are about to be
      destroyed.
    
    * vm_object_terminate() must call vinvalbuf() both before (for normal
      filesystems) and also after (for tmpfs style filesystems).  Otherwise
      buffers potentially not disposed of during the page cleaning might
      get left hanging.  This is a safety feature.
    
    * Remove post-flush test code from vm_object_page_collect_flush() entirely.
      The IO's are in progress at this point so it makes no sense to set
      PG_CLEANCHK here.
    
    * vm_page_need_commit() must make the object writeable and dirty, I think.
    
    * Fix multiple places where m->dirty is tested and PG_NEED_COMMIT is not.
    
    Reported-by: vsrinivas, others

Summary of changes:
 sys/vfs/tmpfs/tmpfs_subr.c  |    2 +-
 sys/vfs/tmpfs/tmpfs_vnops.c |   22 +++++++++-------
 sys/vm/vm_object.c          |   57 ++++++++++++++++++-------------------------
 sys/vm/vm_page.c            |   10 ++++---
 4 files changed, 43 insertions(+), 48 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/d86d27a81d75c46fb451b36f43f87b3300c1a260


-- 
DragonFly BSD source repository



More information about the Commits mailing list