diff options
author | Eric Ren <zren@suse.com> | 2016-05-26 18:16:16 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-05-26 18:35:44 -0400 |
commit | 1f3a437fa027c75b26a64e2e71d7c374ff70f866 (patch) | |
tree | 7c0764d7a80886cd484e158ce17910e2c81bb338 | |
parent | d96c84f8d27ce57ff08f12b9654d9f505a8cce6e (diff) |
ocfs2: fix improper handling of return errno
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/1463970656-18413-1-git-send-email-zren@suse.com
Signed-off-by: Eric Ren <zren@suse.com>
Reviewed-by: Joseph Qi <joseph.qi@huawei.com>
Cc: Mark Fasheh <mfasheh@suse.de>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: Junxiao Bi <junxiao.bi@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | fs/ocfs2/inode.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/fs/ocfs2/inode.c b/fs/ocfs2/inode.c index 0748777f2e2a..c56a7679df93 100644 --- a/fs/ocfs2/inode.c +++ b/fs/ocfs2/inode.c | |||
@@ -176,12 +176,7 @@ struct inode *ocfs2_iget(struct ocfs2_super *osb, u64 blkno, unsigned flags, | |||
176 | } | 176 | } |
177 | if (is_bad_inode(inode)) { | 177 | if (is_bad_inode(inode)) { |
178 | iput(inode); | 178 | iput(inode); |
179 | if ((flags & OCFS2_FI_FLAG_FILECHECK_CHK) || | 179 | inode = ERR_PTR(rc); |
180 | (flags & OCFS2_FI_FLAG_FILECHECK_FIX)) | ||
181 | /* Return OCFS2_FILECHECK_ERR_XXX related errno */ | ||
182 | inode = ERR_PTR(rc); | ||
183 | else | ||
184 | inode = ERR_PTR(-ESTALE); | ||
185 | goto bail; | 180 | goto bail; |
186 | } | 181 | } |
187 | 182 | ||