All of lore.kernel.org
 help / color / mirror / Atom feed
* [Ocfs2-devel] [PATCH] ocfs2: Fix checking of return value of new_inode()
@ 2008-10-20 17:23 Jan Kara
  2008-10-21 20:35 ` Joel Becker
  0 siblings, 1 reply; 4+ messages in thread
From: Jan Kara @ 2008-10-20 17:23 UTC (permalink / raw)
  To: ocfs2-devel

new_inode() does not return ERR_PTR() but NULL in case of failure. Correct
checking of the return value.

Signed-off-by: Jan Kara <jack@suse.cz>
---
 fs/ocfs2/namei.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/ocfs2/namei.c b/fs/ocfs2/namei.c
index d5d808f..0372ef0 100644
--- a/fs/ocfs2/namei.c
+++ b/fs/ocfs2/namei.c
@@ -382,8 +382,8 @@ static int ocfs2_mknod_locked(struct ocfs2_super *osb,
 	}
 
 	inode = new_inode(dir->i_sb);
-	if (IS_ERR(inode)) {
-		status = PTR_ERR(inode);
+	if (!inode) {
+		status = -ENOMEM;
 		mlog(ML_ERROR, "new_inode failed!\n");
 		goto leave;
 	}
-- 
1.5.2.4

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

* [Ocfs2-devel] [PATCH] ocfs2: Fix checking of return value of new_inode()
  2008-10-20 17:23 [Ocfs2-devel] [PATCH] ocfs2: Fix checking of return value of new_inode() Jan Kara
@ 2008-10-21 20:35 ` Joel Becker
  2008-10-22 11:52   ` Jan Kara
  2008-10-24 21:42   ` Joel Becker
  0 siblings, 2 replies; 4+ messages in thread
From: Joel Becker @ 2008-10-21 20:35 UTC (permalink / raw)
  To: ocfs2-devel

On Mon, Oct 20, 2008 at 07:23:53PM +0200, Jan Kara wrote:
> new_inode() does not return ERR_PTR() but NULL in case of failure. Correct
> checking of the return value.
> 
> Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Joel Becker <joel.becker@oracle.com>

Another upstream candidate.

> ---
>  fs/ocfs2/namei.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/ocfs2/namei.c b/fs/ocfs2/namei.c
> index d5d808f..0372ef0 100644
> --- a/fs/ocfs2/namei.c
> +++ b/fs/ocfs2/namei.c
> @@ -382,8 +382,8 @@ static int ocfs2_mknod_locked(struct ocfs2_super *osb,
>  	}
>  
>  	inode = new_inode(dir->i_sb);
> -	if (IS_ERR(inode)) {
> -		status = PTR_ERR(inode);
> +	if (!inode) {
> +		status = -ENOMEM;
>  		mlog(ML_ERROR, "new_inode failed!\n");
>  		goto leave;
>  	}
> -- 
> 1.5.2.4
> 
> 
> _______________________________________________
> Ocfs2-devel mailing list
> Ocfs2-devel at oss.oracle.com
> http://oss.oracle.com/mailman/listinfo/ocfs2-devel

-- 

"Well-timed silence hath more eloquence than speech."  
         - Martin Fraquhar Tupper

Joel Becker
Principal Software Developer
Oracle
E-mail: joel.becker at oracle.com
Phone: (650) 506-8127

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

* [Ocfs2-devel] [PATCH] ocfs2: Fix checking of return value of new_inode()
  2008-10-21 20:35 ` Joel Becker
@ 2008-10-22 11:52   ` Jan Kara
  2008-10-24 21:42   ` Joel Becker
  1 sibling, 0 replies; 4+ messages in thread
From: Jan Kara @ 2008-10-22 11:52 UTC (permalink / raw)
  To: ocfs2-devel

On Tue 21-10-08 13:35:03, Joel Becker wrote:
> On Mon, Oct 20, 2008 at 07:23:53PM +0200, Jan Kara wrote:
> > new_inode() does not return ERR_PTR() but NULL in case of failure. Correct
> > checking of the return value.
> > 
> > Signed-off-by: Jan Kara <jack@suse.cz>
> Signed-off-by: Joel Becker <joel.becker@oracle.com>
> 
> Another upstream candidate.
  Yep. Mark, will you pick it up or should I send you the patch directly?

										Honza
> 
> > ---
> >  fs/ocfs2/namei.c |    4 ++--
> >  1 files changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/fs/ocfs2/namei.c b/fs/ocfs2/namei.c
> > index d5d808f..0372ef0 100644
> > --- a/fs/ocfs2/namei.c
> > +++ b/fs/ocfs2/namei.c
> > @@ -382,8 +382,8 @@ static int ocfs2_mknod_locked(struct ocfs2_super *osb,
> >  	}
> >  
> >  	inode = new_inode(dir->i_sb);
> > -	if (IS_ERR(inode)) {
> > -		status = PTR_ERR(inode);
> > +	if (!inode) {
> > +		status = -ENOMEM;
> >  		mlog(ML_ERROR, "new_inode failed!\n");
> >  		goto leave;
> >  	}
> > -- 
> > 1.5.2.4
> > 
> > 
> > _______________________________________________
> > Ocfs2-devel mailing list
> > Ocfs2-devel at oss.oracle.com
> > http://oss.oracle.com/mailman/listinfo/ocfs2-devel
> 
> -- 
> 
> "Well-timed silence hath more eloquence than speech."  
>          - Martin Fraquhar Tupper
> 
> Joel Becker
> Principal Software Developer
> Oracle
> E-mail: joel.becker at oracle.com
> Phone: (650) 506-8127
-- 
Jan Kara <jack@suse.cz>
SUSE Labs, CR

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

* [Ocfs2-devel] [PATCH] ocfs2: Fix checking of return value of new_inode()
  2008-10-21 20:35 ` Joel Becker
  2008-10-22 11:52   ` Jan Kara
@ 2008-10-24 21:42   ` Joel Becker
  1 sibling, 0 replies; 4+ messages in thread
From: Joel Becker @ 2008-10-24 21:42 UTC (permalink / raw)
  To: ocfs2-devel

On Tue, Oct 21, 2008 at 01:35:03PM -0700, Joel Becker wrote:
> On Mon, Oct 20, 2008 at 07:23:53PM +0200, Jan Kara wrote:
> > new_inode() does not return ERR_PTR() but NULL in case of failure. Correct
> > checking of the return value.
> > 
> > Signed-off-by: Jan Kara <jack@suse.cz>
> Signed-off-by: Joel Becker <joel.becker@oracle.com>
> 
> Another upstream candidate.

	This is now in my xattr-28 branch.

Joel

-- 

Life's Little Instruction Book #139

	"Never deprive someone of hope; it might be all they have."

Joel Becker
Principal Software Developer
Oracle
E-mail: joel.becker at oracle.com
Phone: (650) 506-8127

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

end of thread, other threads:[~2008-10-24 21:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-20 17:23 [Ocfs2-devel] [PATCH] ocfs2: Fix checking of return value of new_inode() Jan Kara
2008-10-21 20:35 ` Joel Becker
2008-10-22 11:52   ` Jan Kara
2008-10-24 21:42   ` Joel Becker

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.