HAMMER 2.1:01 - Stability
authorMatthew Dillon <dillon@dragonflybsd.org>
Wed, 6 Aug 2008 15:38:58 +0000 (15:38 +0000)
committerMatthew Dillon <dillon@dragonflybsd.org>
Wed, 6 Aug 2008 15:38:58 +0000 (15:38 +0000)
commit5c8d05e2efb6a55609eede12343991fcde14dfef
treef300540106a67f8918a0b8c9412becf96590d262
parentcb8d752c91e50d49493e6841a71a3add51e2f2da
HAMMER 2.1:01 - Stability

* Fix a bug in the B-Tree code.  Recursive deletions are done prior to
  marking a node as actually being empty, but setup for the deletion
  (by calling hammer_cursor_deleted_element()) must still occur prior
  to the recursrion so cursor indexes are properly adjusted for the
  possible removal.  If the recursion is not successful we can just leave
  the cursors post-adjusted since the subtree has an empty leaf anyway.

* Rename HAMMER_CURSOR_DELBTREE to HAMMER_CURSOR_RETEST so its function
  is more apparent.

* Properly set the HAMMER_CURSOR_RETEST flag when relocking a cursor
  that has tracked a ripout, so the cursor's new current element is
  re-tested by any iteration using the cursor.

* Remove code that allowed a SETUP record to be converted to a FLUSH
  record if the target inode is already in the correct flush group.
  The problem is that target inode has already setup its sync state
  for the backend and the nlinks count will not be correct if we
  add another directory ADD/DEL record to the flush.  While strictly
  a temporary nlinks mismatch (the next flush would correct it), a
  crash occuring here would result in inconsistent nlink counts on
  the media.

* Reference and release buffers instead of directly calling low level
  hammer_io_deallocate(), and generally reference and release buffers
  around reclamations in the buffer/io invalidation code to avoid
  races.  In particular, the buffer must be referenced during a
  call to hammer_io_clear_modify().

* Fix a buffer leak in hammer_del_buffers() which is not only bad unto
  itself, but can also cause reblocking assertions on the presence of
  buffer aliases later on.

* Return ENOTDIR if rmdir attempts to remove a non-directory.

Reported-by: Francois Tigeot <ftigeot@wolfpond.org> (rmdir)
Reported-by: YONETANI Tomokazu <qhwt+dfly@les.ath.cx> (multiple)
sys/vfs/hammer/hammer_btree.c
sys/vfs/hammer/hammer_cursor.c
sys/vfs/hammer/hammer_cursor.h
sys/vfs/hammer/hammer_inode.c
sys/vfs/hammer/hammer_io.c
sys/vfs/hammer/hammer_object.c
sys/vfs/hammer/hammer_ondisk.c
sys/vfs/hammer/hammer_vnops.c