]> git.hungrycats.org Git - linux/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, 10 Oct 2024 10:00:52 +0000 (12:00 +0200)
commite0f8f7af8a69a62a931d5f37f73fc3ed42e8664c
treec64efe63db5274e090a166ce3da56dabe5cf3e8f
parent33841ebb9f9f2a515dec61c1c4380517ff0d6529
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