Skip to contentSkip to conversation

ocfs2: Fix checking of return value of new_inode()

PATCH New Jan Kara 2 participants 4 messages Oct 20, 2008 – Oct 24, 2008 OCFS2

lore
Share & tools
lore

Jan Kara

author
#0 lore raw

PATCH 1/1 ocfs2: Fix checking of return value of new_inode()

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

---
 fs/ocfs2/namei.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
fs/ocfs2/namei.c +2 -2
index d5d808f..0372ef0 100644
@@ -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;
 	}
Signature · 1 line
1.5.2.4
#1 lore raw

PATCH 1/1 ocfs2: Fix checking of return value of new_inode()

Quoted 4 lines · Jan Kara

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

Another upstream candidate.

Quoted 27 lines
---
 fs/ocfs2/namei.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
fs/ocfs2/namei.c +2 -2
index d5d808f..0372ef0 100644
@@ -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;
 	}
Signature · 7 lines
1.5.2.4


_______________________________________________
Ocfs2-devel mailing list
Ocfs2-devel at oss.oracle.com
http://oss.oracle.com/mailman/listinfo/ocfs2-devel
Signature · 8 lines
"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
author
#2 lore raw

PATCH 1/1 ocfs2: Fix checking of return value of new_inode()

Quoted 8 lines · Joel Becker
Quoted 4 lines · Jan Kara

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

Another upstream candidate.

Yep. Mark, will you pick it up or should I send you the patch directly?

Honza

Quoted 39 lines
Quoted 28 lines
---
 fs/ocfs2/namei.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
fs/ocfs2/namei.c +2 -2
index d5d808f..0372ef0 100644
@@ -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;
 	}
Signature · 7 lines
1.5.2.4


_______________________________________________
Ocfs2-devel mailing list
Ocfs2-devel at oss.oracle.com
http://oss.oracle.com/mailman/listinfo/ocfs2-devel
Signature · 8 lines
"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
Signature · 2 lines
Jan Kara <[email protected]>
SUSE Labs, CR
#3 lore raw

PATCH 1/1 ocfs2: Fix checking of return value of new_inode()

In reply to Joel Becker
Quoted 8 lines · Joel Becker
Quoted 4 lines · Jan Kara

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

Another upstream candidate.

This is now in my xattr-28 branch.

Joel

Signature · 9 lines
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