]> git.baikalelectronics.ru Git - kernel.git/commit
ext4: do not iput inode under running transaction in ext4_rename()
authorzhangyi (F) <yi.zhang@huawei.com>
Wed, 3 Mar 2021 13:17:03 +0000 (21:17 +0800)
committerTheodore Ts'o <tytso@mit.edu>
Sun, 21 Mar 2021 04:09:14 +0000 (00:09 -0400)
commita696316a4c285adc686319fe764a5aa62733cc88
tree331426781ad251b0c88a4c35e69430a536eb60ff
parent5afb3d326fd5d40443721e8d918ae6450b3ed0e5
ext4: do not iput inode under running transaction in ext4_rename()

In ext4_rename(), when RENAME_WHITEOUT failed to add new entry into
directory, it ends up dropping new created whiteout inode under the
running transaction. After commit <9be5d91fe6b> ("ext4: Do not iput inode
under running transaction"), we follow the assumptions that evict() does
not get called from a transaction context but in ext4_rename() it breaks
this suggestion. Although it's not a real problem, better to obey it, so
this patch add inode to orphan list and stop transaction before final
iput().

Signed-off-by: zhangyi (F) <yi.zhang@huawei.com>
Link: https://lore.kernel.org/r/20210303131703.330415-2-yi.zhang@huawei.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
fs/ext4/namei.c