Skip to content

Commit

Permalink
ubifs: Add missing iput if do_tmpfile() failed in rename whiteout
Browse files Browse the repository at this point in the history
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: 9e0a1ff ("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>
  • Loading branch information
Zhihao Cheng authored and richardweinberger committed Jan 9, 2022
1 parent 7a8884f commit 716b457
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions fs/ubifs/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,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)
Expand Down

0 comments on commit 716b457

Please sign in to comment.