osd/scrub: replace a ceph_assert() with a test
We are using two distinct conditions to decide whether a candidate PG is already being scrubbed. The OSD checks pgs_scrub_active(), while the PG asserts on the value of PG_STATE_FLAG.
There is a time window when PG_STATE_FLAG is set but is_scrub_active() wasn't yet set. is_reserving() covers most of that period, but the ceph_assert is just before the is_reserving check.
fixes: https://tracker.ceph.com/issues/50346
Signed-off-by: Ronen Friedman <rfriedma@redhat.com>
(cherry picked from commit
50fbfeffbe76ad683df2dd97e4f65ca6d980e91d)