]> git.baikalelectronics.ru Git - kernel.git/commit
ext4: find old entry again if failed to rename whiteout
authorzhangyi (F) <yi.zhang@huawei.com>
Wed, 3 Mar 2021 13:17:02 +0000 (21:17 +0800)
committerTheodore Ts'o <tytso@mit.edu>
Sun, 21 Mar 2021 04:03:39 +0000 (00:03 -0400)
commit5afb3d326fd5d40443721e8d918ae6450b3ed0e5
tree7015e62beaf3916d42cec195a5e137ec2e4c7ff6
parent033eaebebc40f34a31b79e889508bc77a8e2baef
ext4: find old entry again if failed to rename whiteout

If we failed to add new entry on rename whiteout, we cannot reset the
old->de entry directly, because the old->de could have moved from under
us during make indexed dir. So find the old entry again before reset is
needed, otherwise it may corrupt the filesystem as below.

  /dev/sda: Entry '00000001' in ??? (12) has deleted/unused inode 15. CLEARED.
  /dev/sda: Unattached inode 75
  /dev/sda: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY.

Fixes: 7dff1cc4b18 ("ext4: fix bug for rename with RENAME_WHITEOUT")
Cc: stable@vger.kernel.org
Signed-off-by: zhangyi (F) <yi.zhang@huawei.com>
Link: https://lore.kernel.org/r/20210303131703.330415-1-yi.zhang@huawei.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
fs/ext4/namei.c