From: Kent Overstreet Date: Tue, 18 Dec 2018 15:15:35 +0000 (-0500) Subject: bcachefs: fix ja->cur_idx use while reading journal X-Git-Tag: io_uring-6.7-2023-11-10~119^2~2623 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=a36d3685bbc3a5193f0c284233386d56136363c7;p=linux-block.git bcachefs: fix ja->cur_idx use while reading journal Signed-off-by: Kent Overstreet --- diff --git a/fs/bcachefs/journal_io.c b/fs/bcachefs/journal_io.c index 4178dd9ceb8e..67ff2633ba16 100644 --- a/fs/bcachefs/journal_io.c +++ b/fs/bcachefs/journal_io.c @@ -584,7 +584,7 @@ static void bch2_journal_read_device(struct closure *cl) while (ja->bucket_seq[ja->cur_idx] > min_seq && ja->bucket_seq[ja->cur_idx] > ja->bucket_seq[(ja->cur_idx + 1) % ja->nr]) - ja->cur_idx++; + ja->cur_idx = (ja->cur_idx + 1) % ja->nr; ja->sectors_free = 0;