]> 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)
commit7ef4b1da17dd52e74962e5c6f598e085c8d74990
tree7015e62beaf3916d42cec195a5e137ec2e4c7ff6
parentfc684f316a5dd652064c4e6691e2d611555f5dc3
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: 06d1ed69338 ("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