Skip to content

Commit

Permalink
ocfs2: Let inode be really deleted when ocfs2_mknod_locked() fails
Browse files Browse the repository at this point in the history
We forgot to set i_nlink to 0 when returning due to error from ocfs2_mknod_locked()
and thus inode was not properly released via ocfs2_delete_inode() (e.g. claimed
space was not released). Fix it.

Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Joel Becker <joel.becker@oracle.com>
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
  • Loading branch information
Jan Kara authored and Mark Fasheh committed Nov 10, 2008
1 parent 87cfa00 commit b99835c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion fs/ocfs2/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -491,8 +491,10 @@ static int ocfs2_mknod_locked(struct ocfs2_super *osb,
brelse(*new_fe_bh);
*new_fe_bh = NULL;
}
if (inode)
if (inode) {
clear_nlink(inode);
iput(inode);
}
}

mlog_exit(status);
Expand Down

0 comments on commit b99835c

Please sign in to comment.