]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.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:03:57 +0000 (22:03 +0200)
commit9643789d931e07f37f45729ea45dca3f4d107387
treea627884856e5ac3fe6aa5251cc421bbdc1694e82
parent17d8bd55c9e542f5858fbd64ce8de99d445c0bb8
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