Skip to content

Commit

Permalink
GFS2: add error check while allocating new inodes
Browse files Browse the repository at this point in the history
This patch adds a return code check after attempting to allocate
a new inode during dinode creation.

Signed-off-by: Bob Peterson <rpeterso@redhat.com>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
  • Loading branch information
Bob Peterson authored and Steven Whitehouse committed Nov 16, 2012
1 parent b780416 commit be4f245
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions fs/gfs2/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -674,6 +674,10 @@ static int gfs2_create_inode(struct inode *dir, struct dentry *dentry,
goto fail_gunlock;

inode = new_inode(sdp->sd_vfs);
if (!inode) {
gfs2_glock_dq_uninit(ghs);
return -ENOMEM;
}
ip = GFS2_I(inode);
error = gfs2_rs_alloc(ip);
if (error)
Expand Down

0 comments on commit be4f245

Please sign in to comment.