From: Steven Whitehouse Date: Fri, 16 Nov 2012 15:16:03 +0000 Subject: [Cluster-devel] [GFS2 PATCH] GFS2: add error check while allocating new inodes In-Reply-To: <581283624.41715543.1353075099812.JavaMail.root@redhat.com> References: <581283624.41715543.1353075099812.JavaMail.root@redhat.com> Message-ID: <1353078963.2731.54.camel@menhir> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Hi, On Fri, 2012-11-16 at 09:11 -0500, Bob Peterson wrote: > Hi, > > This patch adds a return code check after attempting to allocate > a new inode during dinode creation. > > Regards, > > Bob Peterson > Red Hat File Systems > Both patches in the -nmw tree now. Thanks, Steve. > Signed-off-by: Bob Peterson > --- > diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c > index e321333..2405695 100644 > --- a/fs/gfs2/inode.c > +++ b/fs/gfs2/inode.c > @@ -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)