]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
osd/scrub: pre-prepare the description text of the current state 46970/head
authorRonen Friedman <rfriedma@redhat.com>
Tue, 5 Jul 2022 13:42:33 +0000 (13:42 +0000)
committerRonen Friedman <rfriedma@redhat.com>
Wed, 27 Jul 2022 05:48:07 +0000 (05:48 +0000)
commit0ebb32213a84c7f3355046c4456b35238a730c23
treea0e9df7a3cd25e1b7e1042d639e634e8c75dc4c1
parent606ec517f7e1ec1416476aaf2232c029855c35c9
osd/scrub: pre-prepare the description text of the current state

The existing code accesses the states of the scrub FSM via the
standard "state iterator", which is definitely not thread-safe.
It is also a bit time consuming.

As it happened, new code that tried to create the state string
while not holding the PG lock - crashed the OSD.
This PR changes the relevant lines to allow for safe and fast
access to the state description text.

Signed-off-by: Ronen Friedman <rfriedma@redhat.com>
src/osd/scrubber/pg_scrubber.cc
src/osd/scrubber/pg_scrubber.h
src/osd/scrubber/scrub_machine.cc
src/osd/scrubber/scrub_machine.h
src/osd/scrubber/scrub_machine_lstnr.h