Whamcloud - gitweb
LU-10958 ofd: data corruption due to RPC reordering 81/32281/18
authorAndrew Perepechko <c17827@cray.com>
Mon, 9 Dec 2019 17:13:50 +0000 (20:13 +0300)
committerOleg Drokin <green@whamcloud.com>
Mon, 8 Feb 2021 21:54:44 +0000 (21:54 +0000)
commit35679a730bf0b7a8d4ce84cadc3ecc7c289ef491
tree2080cf8bce9a73e59c175d1af29b2e3bbeee1347
parent5a0df5c8f3f0fa80967650462e189b326c44882c
LU-10958 ofd: data corruption due to RPC reordering

Without read-only cache, it is possible that a client
resends a BRW RPC, receives a reply from the original
BRW RPC, modifies the same data and sends a new BRW
RPC, however, because of RPC reordering stale data
gets to disk.

Let's use range locking to protect against this race.

Change-Id: I35cbf95594601eacfc5f108b14e4c447962b0bbf
Signed-off-by: Andrew Perepechko <c17827@cray.com>
Cray-bug-id: LUS-5578,LUS-8943
Reviewed-on: https://review.whamcloud.com/32281
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Alexey Lyashkov <alexey.lyashkov@hpe.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
15 files changed:
lustre/include/Makefile.am
lustre/include/range_lock.h [moved from lustre/llite/range_lock.h with 100% similarity]
lustre/ldlm/Makefile.am
lustre/llite/Makefile.in
lustre/llite/llite_internal.h
lustre/obdclass/Makefile.in
lustre/obdclass/interval_tree.c [moved from lustre/ldlm/interval_tree.c with 99% similarity]
lustre/obdclass/range_lock.c [moved from lustre/llite/range_lock.c with 97% similarity]
lustre/ofd/ofd_dev.c
lustre/ofd/ofd_internal.h
lustre/ofd/ofd_io.c
lustre/ptlrpc/Makefile.in
lustre/ptlrpc/autoMakefile.am
lustre/target/tgt_handler.c
lustre/tests/recovery-small.sh