git: hammer2 - Fix bulkfree bug when multiple PFSs are mounted
Matthew Dillon
dillon at crater.dragonflybsd.org
Tue Apr 26 10:07:05 PDT 2022
commit 6e964f3c30bfd89a72e430769c5dc4a6156415c3
Author: Matthew Dillon <dillon at apollo.backplane.com>
Date: Mon Apr 25 19:21:38 2022 -0700
hammer2 - Fix bulkfree bug when multiple PFSs are mounted
* If multiple PFSs from the same block device are mounted, the bulkfree
directive can sometimes free blocks that are actually not free.
This situation can only occur:
(1) When 2 or more PFS's are mounted from the same block device.
(2) When heavy file ops occur near the start of a bulkfree.
* The problem was due to the bulkfree code only flushing the
passed-in PFS before starting the scan on the device (which might
house multiple PFSs). This can cause both scan stages to occur
without a full synchronization of all modified PFSs on the device
inbetween them.
* Fixes by ensuring that all PFSs associated with the block device
are flushed with the blockfree lock held in order to get the guarantee
back.
Summary of changes:
sys/vfs/hammer2/hammer2_ioctl.c | 48 +++++++++++++++++++------------
sys/vfs/hammer2/hammer2_vfsops.c | 62 ++--------------------------------------
2 files changed, 31 insertions(+), 79 deletions(-)
http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/6e964f3c30bfd89a72e430769c5dc4a6156415c3
--
DragonFly BSD source repository
More information about the Commits
mailing list