DragonFlyBSD/src 75a42a5sys/vfs/hammer2 hammer2_vnops.c

hammer2 - Finally fix the 'file winds up with some zeros' bug

* Fix this bug, which has been reported several times this year
  but until nikita's hands-on I couldn't find it.

* The bug occurs when H2 must transition from the 512 bytes of
  file data directly embedded in the inode to a block table as
  a file grows past 512 bytes.

  Basically what happens is that the buffer cache buffer holding
  the data in-transition can get lost.

  The result is that the first write() that overlaps seek offset
  512 in a small file can sometimes cause the prior data at the
  start of the file to be lost.

* To solve the problem the buffer is now held across the transition
  and explicitly dirtied to force it to be flushed to the now-
  realized block table.

Reported-by: nikita and several others this year
DeltaFile
+25-5sys/vfs/hammer2/hammer2_vnops.c
+25-51 files

UnifiedSplitRaw