]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
crimson/os/seastore/cbj: fix a potential overflow bug 53968/head
authorMyoungwon Oh <myoungwon.oh@samsung.com>
Thu, 31 Aug 2023 02:43:24 +0000 (11:43 +0900)
committerMatan Breizman <mbreizma@redhat.com>
Wed, 11 Oct 2023 11:54:43 +0000 (11:54 +0000)
commitcac553aa72da18263437b87ad86945bb1e4cb197
treee08c008695528c8447e9f57e823ebe6023c221fc
parent281a9fba66f3aef385178a4640ad8e7c35747e0c
crimson/os/seastore/cbj: fix a potential overflow bug

CircularBoundedJournal is similar to circular queue, so segment_seq
increases after rolling. However, current implementation always
increases segment_seq_t when rolling occurs, resulting in
the overflow if segment_seq_t hits MAX_SEG_SEQ.

To mitigate this, this commit changes the type of the segment_seq_t
to uint64_t.

Signed-off-by: Myoungwon Oh <myoungwon.oh@samsung.com>
(cherry picked from commit 36982b66574ff277e04a02d5b9a28e80d0790778)
src/crimson/os/seastore/journal/circular_journal_space.cc
src/crimson/os/seastore/seastore_types.h