hammer2 - Fix lost flush
authorMatthew Dillon <dillon@apollo.backplane.com>
Sun, 20 May 2012 18:12:58 +0000 (11:12 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Sun, 20 May 2012 18:12:58 +0000 (11:12 -0700)
commit26b047fa2d693b02fafbb86a1b2448ce38a4e84c
treea7477e81e7607773ff610d9e9127ed16621a544f
parent4c5b0fa8cc468260bf73440fb6893c18ddcb4ab7
hammer2 - Fix lost flush

* hammer2 allows the buffer cache buffers related to MODIFIED but unlocked
  chains to be retired by the OS.  In this situation hammer2 does not want
  to bdwrite() the buffer again unless additional modifications are made,
  even though the MODIFIED bit in the chain remains set throughout the
  entire sequence.

* Fix a case where these additional modifications were not properly flagging
  for the buffer cache buffer to be retired with a bdwrite(), causing data
  loss.  This is related to the DIRTYBP chain flag.

* Make further adjustments to the DIRTYBP chain flag.

* Also fix a case where the MOVED bit might not get properly set when a
  block is resized.  The problem was masked by the fact that a resize
  only occurs on data blocks and only during a write(), so the related
  buffer was being marked MODIFIED anyway.  However, the resize code still
  needed to be corrected.

* Add some debugging to 'hammer2 stat' to make it easier to poke around
  related kernel structures.
sbin/hammer2/cmd_stat.c
sys/vfs/hammer2/hammer2_chain.c
sys/vfs/hammer2/hammer2_inode.c
sys/vfs/hammer2/hammer2_ioctl.c
sys/vfs/hammer2/hammer2_ioctl.h