]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ext4: avoid resizing to a partial cluster size
authorKiselev, Oleg <okiselev@amazon.com>
Wed, 20 Jul 2022 04:27:48 +0000 (04:27 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Aug 2022 09:18:35 +0000 (11:18 +0200)
commita6805b3dcf5cd41f2ae3a03dca43411135b99849
treeaa7cfe98999a1a03eae774295840ca693f07ce41
parent5bebfd6077266aed0e3db75278d0f7c3a620fa5c
ext4: avoid resizing to a partial cluster size

[ Upstream commit 69cb8e9d8cd97cdf5e293b26d70a9dee3e35e6bd ]

This patch avoids an attempt to resize the filesystem to an
unaligned cluster boundary.  An online resize to a size that is not
integral to cluster size results in the last iteration attempting to
grow the fs by a negative amount, which trips a BUG_ON and leaves the fs
with a corrupted in-memory superblock.

Signed-off-by: Oleg Kiselev <okiselev@amazon.com>
Link: https://lore.kernel.org/r/0E92A0AB-4F16-4F1A-94B7-702CC6504FDE@amazon.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/ext4/resize.c