git: DragonFly_RELEASE_4_6 hammer - Try to fix improper DATA CRC error
Matthew Dillon
dillon at crater.dragonflybsd.org
Sat Jul 23 21:00:56 PDT 2016
commit 7d886917ee2576f6736f3f2bb36d153e996dfb26
Author: Matthew Dillon <dillon at apollo.backplane.com>
Date: Sat Jul 23 19:09:26 2016 -0700
hammer - Try to fix improper DATA CRC error
* Under heavy I/O loads HAMMER has an optimization (similar to UFS) where
the logical buffer is used to issue a write to the underlying device,
rather than copying the logical buffer to a device buffer. This
optmization is earmarked by a hammer2_record.
* If the logical buffer is discarded just after it is written, and then
re-read, hammer may go through a path which calls
hammer_ip_resolve_data(). This code failed to check whether the record
was still in-progress, and in-fact the write to the device may not have
even been initiated yet, and there could also have been a device buffer
alias in the buffer cache for the device for the offset.
This caused the followup read to access the wrong data, causing HAMMER
to report a DATA CRC error. The actual media receives the correct data
eventually and a umount/remount would show an uncorrupted file.
* Try to fix the problem by calling hammer_io_direct_wait() on the record
in this path to wait for the operation to complete (and also to
invalidate the related device buffer) before trying to re-read the block
from the media.
Summary of changes:
sys/vfs/hammer/hammer_object.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/7d886917ee2576f6736f3f2bb36d153e996dfb26
--
DragonFly BSD source repository
More information about the Commits
mailing list