Skip to contentSkip to conversation

ocfs2: fix improper handling of return errno

PATCH Applied Eric Ren 3 participants 3 messages May 23, 2016 OCFS2

lore
Share & tools
lore

Eric Ren

author
#0 lore raw

PATCH 1/1 ocfs2: fix improper handling of return errno

Previously, if bad inode was found in ocfs2_iget(), -ESTALE?was returned back to the caller anyway. Since commit d2b9d71a2da7 ("ocfs2: check/fix inode block for online file check") can handle with return value from ocfs2_read_locked_inode() now, we know the exact errno returned for us.

---
 fs/ocfs2/inode.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
fs/ocfs2/inode.c +1 -6
index ba495be..fee5ec6 100644
@@ -176,12 +176,7 @@ struct inode *ocfs2_iget(struct ocfs2_super *osb, u64 blkno, unsigned flags,
 	}
 	if (is_bad_inode(inode)) {
 		iput(inode);
-		if ((flags & OCFS2_FI_FLAG_FILECHECK_CHK) ||
-		    (flags & OCFS2_FI_FLAG_FILECHECK_FIX))
-			/* Return OCFS2_FILECHECK_ERR_XXX related errno */
-			inode = ERR_PTR(rc);
-		else
-			inode = ERR_PTR(-ESTALE);
+		inode = ERR_PTR(rc);
 		goto bail;
 	}
 
Signature · 1 line
2.6.6
#1 lore raw

PATCH 1/1 ocfs2: fix improper handling of return errno

Quoted 7 lines · Eric Ren

Previously, if bad inode was found in ocfs2_iget(), -ESTALE was returned back to the caller anyway. Since commit d2b9d71a2da7 ("ocfs2: check/fix inode block for online file check") can handle with return value from ocfs2_read_locked_inode() now, we know the exact errno returned for us.

Looks good to me, thanks.

Quoted 23 lines
---
 fs/ocfs2/inode.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
fs/ocfs2/inode.c +1 -6
index ba495be..fee5ec6 100644
@@ -176,12 +176,7 @@ struct inode *ocfs2_iget(struct ocfs2_super *osb, u64 blkno, unsigned flags,
 	}
 	if (is_bad_inode(inode)) {
 		iput(inode);
-		if ((flags & OCFS2_FI_FLAG_FILECHECK_CHK) ||
-		    (flags & OCFS2_FI_FLAG_FILECHECK_FIX))
-			/* Return OCFS2_FILECHECK_ERR_XXX related errno */
-			inode = ERR_PTR(rc);
-		else
-			inode = ERR_PTR(-ESTALE);
+		inode = ERR_PTR(rc);
 		goto bail;
 	}
 
#2 lore raw

PATCH 1/1 ocfs2: fix improper handling of return errno

Quoted 11 lines
Quoted 4 lines
Quoted 4 lines
Quoted 6 lines · Eric Ren

Previously, if bad inode was found in ocfs2_iget(), -ESTALE was returned back to the caller anyway. Since commit d2b9d71a2da7 ("ocfs2: check/fix inode block for online file check") can handle with return value from ocfs2_read_locked_inode() now, we know the exact errno returned for us.

Quoted 3 lines
Quoted 1 line

Looks good to me, thanks.

Quoted 32 lines

fs/ocfs2/inode.c struct inode *ocfs2_iget(struct ocfs2_super *osb, u64

Quoted 10 lines
---
 fs/ocfs2/inode.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
fs/ocfs2/inode.c +0 -0
index ba495be..fee5ec6 100644
@@ -176,12 +176,7 @@ struct inode *ocfs2_iget(struct ocfs2_super *osb, u64 

blkno, unsigned flags,

Quoted 4 lines
fs/ocfs2/inode.c +0 -0
 	}
 	if (is_bad_inode(inode)) {
 		iput(inode);

fs/ocfs2/inode.c struct inode *ocfs2_iget(struct ocfs2_super *osb, u64 blkno, unsigned flags, · line 182

Quoted 10 lines
fs/ocfs2/inode.c +1 -6
-		if ((flags & OCFS2_FI_FLAG_FILECHECK_CHK) ||
-		    (flags & OCFS2_FI_FLAG_FILECHECK_FIX))
-			/* Return OCFS2_FILECHECK_ERR_XXX related errno */
-			inode = ERR_PTR(rc);
-		else
-			inode = ERR_PTR(-ESTALE);
+		inode = ERR_PTR(rc);
 		goto bail;
 	}
 

_______________________________________________
Ocfs2-devel mailing list
Ocfs2-devel at oss.oracle.com
https://oss.oracle.com/mailman/listinfo/ocfs2-devel