]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
rgw: address crash and race in RGWIndexCompletionManager 50538/head
authorJ. Eric Ivancich <ivancich@redhat.com>
Tue, 12 Apr 2022 18:47:45 +0000 (14:47 -0400)
committerKonstantin Shalygin <k0ste@k0ste.ru>
Wed, 24 Jul 2024 17:32:24 +0000 (00:32 +0700)
commit5edd20a6bc3edffea0c5b71c4a06fe37b9d07885
tree99fdebb2da2bab30834370f8457554af70c32b33
parentbc3f96b4d8985987fafad1495e023562ad9e61c1
rgw: address crash and race in RGWIndexCompletionManager

An atomic int was used in a modulo operator to distribute contention
among a set of locks and to track completions. Because it was an int,
enough increments would cause it to go negative (due to
twos-complement encoding and overflow) thereby causing a
crash. Additionally, even though it was atomic, the read and increment
were separate operations, leading to a race.

This commit addresses both of these issues.

Signed-off-by: J. Eric Ivancich <ivancich@redhat.com>
(cherry picked from commit 41f4e83cf5c1c89cd2aa22658716239c4197db0e)
src/rgw/rgw_rados.cc