diff options
author | Yuri Weinstein <yweinste@redhat.com> | 2021-12-14 00:19:14 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-14 00:19:14 +0100 |
commit | 6d5c4e02922f11d3f59fd1b341f0da19632cbc19 (patch) | |
tree | 719963489fb64156703dca0887de7ce816a080a3 /src/os | |
parent | Merge pull request #44298 from adamemerson/wip-leveldb-release-note (diff) | |
parent | os/bluestore: Protect _clone against sudden omap format changes (diff) | |
download | ceph-6d5c4e02922f11d3f59fd1b341f0da19632cbc19.tar.xz ceph-6d5c4e02922f11d3f59fd1b341f0da19632cbc19.zip |
Merge pull request #43857 from aclamk/wip-aclamk-omap-clone-assert
os/bluestore: Protect _clone against sudden omap format changes
Reviewed-by: Igor Fedotov <ifedotov@suse.com>
Diffstat (limited to 'src/os')
-rw-r--r-- | src/os/bluestore/BlueStore.cc | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index 465417ac3ae..848c84adddd 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -16269,6 +16269,9 @@ int BlueStore::_clone(TransContext *txc, } else { newo->onode.set_omap_flags(per_pool_omap == OMAP_BULK); } + // check if prefix for omap key is exactly the same size for both objects + // otherwise rewrite_omap_key will corrupt data + ceph_assert(oldo->onode.flags == newo->onode.flags); const string& prefix = newo->get_omap_prefix(); KeyValueDB::Iterator it = db->get_iterator(prefix); string head, tail; |