]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
common/TrackedOp: fix race updating description with proper lock
authorPatrick Donnelly <pdonnell@redhat.com>
Wed, 26 Jul 2023 16:55:07 +0000 (12:55 -0400)
committerPatrick Donnelly <pdonnell@redhat.com>
Mon, 9 Oct 2023 15:37:38 +0000 (11:37 -0400)
commit93586fd6e9ffbec0fa4d10e766a7047928d50b8c
treef1f1b7d9366136bf1df95c0ec412d6eaa3f54eaf
parent4da4bb3c7146e0392d46fb9224364e7cdf7ce7f6
common/TrackedOp: fix race updating description with proper lock

It is not safe to "cache" a member which may be changed by a racing thread.

This reworks the locking so we can do a light-weight check if the description
is already generated wihtout acquiring the heavier TrackedOp::lock. If it's not
available yet or it needs regenerated, then get the proper locks to generate
it.

Fixes: e45f5c2c33508bec3b177e51fd6cc5fde1f0e674
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
(cherry picked from commit 36eaa495eb37485796ce57c8c4b1cca603efc193)
src/common/TrackedOp.h
src/mds/Mutation.cc
src/mds/Mutation.h
src/mon/MonOpRequest.h
src/osd/OpRequest.cc
src/osd/OpRequest.h