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

git: kernel - Fix bug in uiomove() error handling, fix deadlock in read_shortcut


From: Matthew Dillon <dillon@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 26 Mar 2013 16:42:26 -0700 (PDT)

commit 862481e51f6ea1ac44befc9b9f79a0745daced2e
Author: Matthew Dillon <dillon@apollo.backplane.com>
Date:   Tue Mar 26 16:35:56 2013 -0700

    kernel - Fix bug in uiomove() error handling, fix deadlock in read_shortcut
    
    * Fix a recently introduced bug in uiomove() related to error handling
      when iovcnt is greater than 1.
    
    * Fix a deadlock in the vm.read_shortcut code, rare triggerable except
      by vkernels.
    
      The deadlock is due to a busied VM page being held across a uiomove().
      To fix a new function uiomove_nofault() was added which causes EFAULT
      to be returned for any non-trivial VM fault (any fault related to nested
      objects or vnode objects).
    
      The vop_helper_read_shortcut() procedure uses this new uiomove function
      and breaks out when the case occurs, returning and falling through to
      the filesystem's normal buffer-cache-based read() code.
    
    * As an added bonus, we no longer have to unlock the VM object across
      the new uiomove_nofault() call in the read shorcut code, since it is
      no longer possible to deadlock against the VM object.
    
    Reported-by: tuxillo

Summary of changes:
 sys/kern/kern_subr.c  | 39 +++++++++++++++++++++++++++++++--------
 sys/kern/vfs_helper.c | 20 ++++++++++++++------
 sys/sys/thread.h      |  1 +
 sys/sys/uio.h         |  1 +
 sys/vm/vm_fault.c     | 40 ++++++++++++++++++++++++++++++++++++++++
 5 files changed, 87 insertions(+), 14 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/862481e51f6ea1ac44befc9b9f79a0745daced2e


-- 
DragonFly BSD source repository



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