GFS2: add error check while allocating new inodes

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>
This commit is contained in:
Bob Peterson 2012-11-16 09:11:39 -05:00 committed by Steven Whitehouse
parent b7804161a3
commit be4f245dbb
1 changed files with 4 additions and 0 deletions

View File

@ -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)