]> www.infradead.org Git - users/dwmw2/linux.git/commit
rbd: get snapshot context after exclusive lock is ensured to be held
authorIlya Dryomov <idryomov@gmail.com>
Mon, 5 Jun 2023 14:33:35 +0000 (16:33 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 14 Jun 2023 09:16:58 +0000 (11:16 +0200)
commit40a9ec704b1b2a74fc88e4cc1efc5bebfef0a1c0
tree16f54ab597aff6a1faa1ade62047dc95abb93a9f
parentb57d8a8ef75c29b4c519b90f269128ee48674339
rbd: get snapshot context after exclusive lock is ensured to be held

commit 870611e4877eff1e8413c3fb92a585e45d5291f6 upstream.

Move capturing the snapshot context into the image request state
machine, after exclusive lock is ensured to be held for the duration of
dealing with the image request.  This is needed to ensure correctness
of fast-diff states (OBJECT_EXISTS vs OBJECT_EXISTS_CLEAN) and object
deltas computed based off of them.  Otherwise the object map that is
forked for the snapshot isn't guaranteed to accurately reflect the
contents of the snapshot when the snapshot is taken under I/O.  This
breaks differential backup and snapshot-based mirroring use cases with
fast-diff enabled: since some object deltas may be incomplete, the
destination image may get corrupted.

Cc: stable@vger.kernel.org
Link: https://tracker.ceph.com/issues/61472
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Reviewed-by: Dongsheng Yang <dongsheng.yang@easystack.cn>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/block/rbd.c