]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ext4: avoid remove directory when directory is corrupted
authorYe Bin <yebin10@huawei.com>
Wed, 22 Jun 2022 09:02:23 +0000 (17:02 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Aug 2022 09:18:35 +0000 (11:18 +0200)
commit5bebfd6077266aed0e3db75278d0f7c3a620fa5c
treedc17b7d221fa62db0931c806bd6e72516d8a0b5a
parentf5d46f1b47f65da1faf468277b261eb78c8e25b5
ext4: avoid remove directory when directory is corrupted

[ Upstream commit b24e77ef1c6d4dbf42749ad4903c97539cc9755a ]

Now if check directoy entry is corrupted, ext4_empty_dir may return true
then directory will be removed when file system mounted with "errors=continue".
In order not to make things worse just return false when directory is corrupted.

Signed-off-by: Ye Bin <yebin10@huawei.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Link: https://lore.kernel.org/r/20220622090223.682234-1-yebin10@huawei.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/ext4/namei.c