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

cvs commit: src/sys/vfs/ufs ffs_balloc.c


From: Matthew Dillon <dillon@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Sun, 28 Aug 2005 16:23:10 -0700 (PDT)

dillon      2005/08/28 16:23:10 PDT

DragonFly src repository

  Modified files:
    sys/vfs/ufs          ffs_balloc.c 
  Log:
  Fix a deadlock in ffs_balloc().  This function was incorrectly obtaining a
  locked indirect buffer followed by a locked data block buffer, where as other
  procedures in the kernel generally held a locked data buffer and then
  called procedures which locked the indirect buffer.  Programs like rtorrent,
  which write data into the mmap'd files whos blocks had not yet been
  allocated, could easily deadlock the vnode.
  
  A typical deadlock would be: syncer calls putpages->ffs_write->balloc->getblk->
  allocbuf->(blocked on VM page with indirect block and data block locked), while
  at the same time some process takes a write fault which locks the VM page and
  then attempts to do a BMAP, blocking on the indirect block buffer.  Deadlock.
  
  The fix for ffs_balloc() is simply to obtain the data buffer prior to
  obtaining the indirect block(s).
  
  Reported-by: Mitja Horvat
  MFC: 1 week
  
  Revision  Changes    Path
  1.12      +88 -30    src/sys/vfs/ufs/ffs_balloc.c


http://www.dragonflybsd.org/cvsweb/src/sys/vfs/ufs/ffs_balloc.c.diff?r1=1.11&r2=1.12&f=u



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