ubifs: Add missing iput if do_tmpfile() failed in rename whiteout
authorZhihao Cheng <chengzhihao1@huawei.com>
Mon, 27 Dec 2021 03:22:35 +0000 (11:22 +0800)
committerRichard Weinberger <richard@nod.at>
Sun, 9 Jan 2022 20:47:05 +0000 (21:47 +0100)
commit716b4573026bcbfa7b58ed19fe15554bac66b082
treee178ff0bae55c81032f2b3f4a6d53998bb49979a
parent7a8884feec908afd05ebd45db5eba9a03674137e
ubifs: Add missing iput if do_tmpfile() failed in rename whiteout

whiteout inode should be put when do_tmpfile() failed if inode has been
initialized. Otherwise we will get following warning during umount:
  UBIFS error (ubi0:0 pid 1494): ubifs_assert_failed [ubifs]: UBIFS
  assert failed: c->bi.dd_growth == 0, in fs/ubifs/super.c:1930
  VFS: Busy inodes after unmount of ubifs. Self-destruct in 5 seconds.

Fixes: 9e0a1fff8db56ea ("ubifs: Implement RENAME_WHITEOUT")
Signed-off-by: Zhihao Cheng <chengzhihao1@huawei.com>
Suggested-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Richard Weinberger <richard@nod.at>
fs/ubifs/dir.c