]> git.itanic.dy.fi Git - linux-stable/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:09:31 +0000 (11:09 +0200)
commit53f62a4201be1cfc1e3c971e566888b182c3ffb0
tree2ee025dc7c55334b908868dd9d2c9484789d5455
parent835f95d6776012f3e8d8e97a7cd142c6215a38d2
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