]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
crimson/osd/osd_operations/snaptrim_event: fix lifetime management 54431/head
authorMatan Breizman <mbreizma@redhat.com>
Thu, 9 Nov 2023 09:39:23 +0000 (09:39 +0000)
committerMatan Breizman <mbreizma@redhat.com>
Sun, 12 Nov 2023 14:12:39 +0000 (14:12 +0000)
commitcdee9b928ff9a410e6e0f38aa791756829d68358
treea0f43eb597745fd53f37401795f018ad730a71c0
parent011cf0e9919470331eb1229b7ab9bd07e38e2f14
crimson/osd/osd_operations/snaptrim_event: fix lifetime management

The operation's id and future returned when starting SnapTrimObjSubEvent
is emplaced into subop_blocker.
Later on, we await the completion of all the started operations futures.
Before this patch, we only stored the op id in the subop_blocker vector
which allowed `op` to go out of scope and lose all its references
(and get deleted) before exiting.

Storing the operation as a reference instead of the id
will maintain the SnapTrimObjSubEvent operation lifetime.

Fixes: https://tracker.ceph.com/issues/63299
Signed-off-by: Matan Breizman <mbreizma@redhat.com>
src/crimson/osd/osd_operations/snaptrim_event.cc
src/crimson/osd/osd_operations/snaptrim_event.h