]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
librbd/migration: prune snapshot extents in RawFormat::list_snaps()
authorIlya Dryomov <idryomov@gmail.com>
Sat, 31 Aug 2024 10:33:55 +0000 (12:33 +0200)
committerIlya Dryomov <idryomov@gmail.com>
Sun, 8 Sep 2024 20:13:48 +0000 (22:13 +0200)
commitfded43d90199efbfcd91ae4d93b49df4130f6c00
treea047051da9691392b0972861fde42969b259ab56
parent1c5845d8a8d44f0b6991dc727fb3858d0a85c989
librbd/migration: prune snapshot extents in RawFormat::list_snaps()

list-snaps is exempt from clipping in ImageDispatcher::PreprocessVisitor
because it's considered to be an internal API.  Further, reads issued
by ObjectCopyRequest based on list-snaps results may also be exempt
because of READ_FLAG_DISABLE_CLIPPING.

Since RawFormat allows specifying a set of snapshots (possibly of
varying size!) to be imported, it needs to compensate for that in its
list-snaps implementation.  Otherwise, an out-of-bounds read will
eventually be submitted to the stream.

Fixes: https://tracker.ceph.com/issues/67845
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
(cherry picked from commit d9192b5aca156b706f14bd858df6fb3e45050079)
qa/workunits/rbd/cli_migration.sh
src/librbd/migration/RawFormat.cc
src/test/librbd/migration/test_mock_RawFormat.cc