Skip to content

Commit 965b5dd

Browse files
Tetsuo Handaakpm00
authored andcommitted
ocfs2: free inode when ocfs2_get_init_inode() fails
syzbot is reporting busy inodes after unmount, for commit 9c89fe0 ("ocfs2: Handle error from dquot_initialize()") forgot to call iput() when new_inode() succeeded and dquot_initialize() failed. Link: https://lkml.kernel.org/r/[email protected] Fixes: 9c89fe0 ("ocfs2: Handle error from dquot_initialize()") Signed-off-by: Tetsuo Handa <[email protected]> Reported-by: [email protected] Closes: https://syzkaller.appspot.com/bug?extid=0af00f6a2cba2058b5db Tested-by: [email protected] Reviewed-by: Joseph Qi <[email protected]> Cc: Mark Fasheh <[email protected]> Cc: Joel Becker <[email protected]> Cc: Junxiao Bi <[email protected]> Cc: Changwei Ge <[email protected]> Cc: Jun Piao <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent 985ebec commit 965b5dd

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

fs/ocfs2/namei.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,8 +200,10 @@ static struct inode *ocfs2_get_init_inode(struct inode *dir, umode_t mode)
200200
mode = mode_strip_sgid(&nop_mnt_idmap, dir, mode);
201201
inode_init_owner(&nop_mnt_idmap, inode, dir, mode);
202202
status = dquot_initialize(inode);
203-
if (status)
203+
if (status) {
204+
iput(inode);
204205
return ERR_PTR(status);
206+
}
205207

206208
return inode;
207209
}

0 commit comments

Comments
 (0)