ocfs2: fix improper handling of return errno
authorEric Ren <[email protected]>
Thu, 26 May 2016 22:16:16 +0000 (15:16 -0700)
committerLinus Torvalds <[email protected]>
Thu, 26 May 2016 22:35:44 +0000 (15:35 -0700)
Previously, if a 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.

Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Eric Ren <[email protected]>
Reviewed-by: Joseph Qi <[email protected]>
Cc: Mark Fasheh <[email protected]>
Cc: Joel Becker <[email protected]>
Cc: Junxiao Bi <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
fs/ocfs2/inode.c

index 0748777f2e2a0dcef7e269897e8d5694e05f56f8..c56a7679df93a2bc3df147fe8f408b74221988cb 100644 (file)
@@ -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;
        }