]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
osd/scrub: make sched-targets comparator transitive
authorRonen Friedman <rfriedma@redhat.com>
Wed, 16 Oct 2024 12:04:38 +0000 (07:04 -0500)
committerRonen Friedman <rfriedma@redhat.com>
Tue, 22 Oct 2024 09:39:54 +0000 (04:39 -0500)
commit9f3e18b97cb0930bcbc3145301f9479bb5c3ce4e
treed75b2ce53062ba366f8771b8d2d296d7d921460c
parent4a5715fdcb0c346e5a517c348ab42c595d8e875a
osd/scrub: make sched-targets comparator transitive

The comparator used to sort the scrub targets wasn't transitive, which
can lead to undefined behavior (and likely - to a crash of the sort
algorithm in some implementations). That - due to the clause comparing
the two targets of the same PG.

This commit fixes the comparator. The sorted queue is no longer
guaranteed to have a ripe deep target before the corresponding
shallow one, which is less than optimal - but it won't crash.

Signed-off-by: Ronen Friedman <rfriedma@redhat.com>
src/osd/scrubber/scrub_queue_entry.h