]> 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, 1 Sep 2024 17:37:30 +0000 (19:37 +0200)
commitd9192b5aca156b706f14bd858df6fb3e45050079
treea25ce93db69d3491c814338b025d6d21fa6b4fa6
parent5d64c9c5cda5c1ca44c349cfb9e4f1e9eac21bd5
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>
qa/workunits/rbd/cli_migration.sh
src/librbd/migration/RawFormat.cc
src/test/librbd/migration/test_mock_RawFormat.cc