]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
rgw: address crash and race in RGWIndexCompletionManager 45882/head
authorJ. Eric Ivancich <ivancich@redhat.com>
Tue, 12 Apr 2022 18:47:45 +0000 (14:47 -0400)
committerJ. Eric Ivancich <ivancich@redhat.com>
Tue, 26 Apr 2022 22:36:19 +0000 (18:36 -0400)
commit41f4e83cf5c1c89cd2aa22658716239c4197db0e
tree8006f36de642c2d0b425ac314f2b842e8cb49c62
parenta32221cb9a00c40a0c783eaf8296e5bb513b4c83
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>
src/rgw/rgw_rados.cc