cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
* [Cluster-devel] [GFS2 PATCH] GFS2: add error check while allocating new inodes
@ 2012-11-16 14:11 Bob Peterson
  2012-11-16 15:16 ` Steven Whitehouse
  0 siblings, 1 reply; 2+ messages in thread
From: Bob Peterson @ 2012-11-16 14:11 UTC (permalink / raw)
  To: cluster-devel.redhat.com

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

Signed-off-by: Bob Peterson <rpeterso@redhat.com> 
---
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)



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [Cluster-devel] [GFS2 PATCH] GFS2: add error check while allocating new inodes
  2012-11-16 14:11 [Cluster-devel] [GFS2 PATCH] GFS2: add error check while allocating new inodes Bob Peterson
@ 2012-11-16 15:16 ` Steven Whitehouse
  0 siblings, 0 replies; 2+ messages in thread
From: Steven Whitehouse @ 2012-11-16 15:16 UTC (permalink / raw)
  To: cluster-devel.redhat.com

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 <rpeterso@redhat.com> 
> ---
> 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)




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-11-16 15:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-16 14:11 [Cluster-devel] [GFS2 PATCH] GFS2: add error check while allocating new inodes Bob Peterson
2012-11-16 15:16 ` Steven Whitehouse

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).