Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e92c4457 authored by Zhihao Cheng's avatar Zhihao Cheng Committed by Greg Kroah-Hartman
Browse files

ubifs: Add missing iput if do_tmpfile() failed in rename whiteout



commit 716b4573026bcbfa7b58ed19fe15554bac66b082 upstream.

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: 9e0a1fff ("ubifs: Implement RENAME_WHITEOUT")
Signed-off-by: default avatarZhihao Cheng <chengzhihao1@huawei.com>
Suggested-by: default avatarSascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: default avatarRichard Weinberger <richard@nod.at>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 6e84a56c
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -376,6 +376,8 @@ static int do_tmpfile(struct inode *dir, struct dentry *dentry,
	make_bad_inode(inode);
	if (!instantiated)
		iput(inode);
	else if (whiteout)
		iput(*whiteout);
out_budg:
	ubifs_release_budget(c, &req);
	if (!instantiated)