]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ext4: fix incorrect tid assumption in jbd2_journal_shrink_checkpoint_list()
authorLuis Henriques (SUSE) <luis.henriques@linux.dev>
Wed, 24 Jul 2024 16:11:17 +0000 (17:11 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 17 Oct 2024 13:11:38 +0000 (15:11 +0200)
commit13e4a67f9508c34d3cf2f10e71eb3dde2316e0c0
treeccc507f58fee2ac7471425fe6fefa063b1b2faf5
parent3c1777a490ac7f3137b1b506469e3c709b87b493
ext4: fix incorrect tid assumption in jbd2_journal_shrink_checkpoint_list()

commit 7a6443e1dad70281f99f0bd394d7fd342481a632 upstream.

Function jbd2_journal_shrink_checkpoint_list() assumes that '0' is not a
valid value for transaction IDs, which is incorrect.  Don't assume that and
use two extra boolean variables to control the loop iterations and keep
track of the first and last tid.

Signed-off-by: Luis Henriques (SUSE) <luis.henriques@linux.dev>
Reviewed-by: Jan Kara <jack@suse.cz>
Link: https://patch.msgid.link/20240724161119.13448-4-luis.henriques@linux.dev
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Cc: stable@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/jbd2/checkpoint.c