Skip to content

Commit

Permalink
ceph: fix special error code in ceph_try_get_caps()
Browse files Browse the repository at this point in the history
There are 3 speical error codes: -EAGAIN/-EFBIG/-ESTALE.
After calling try_get_cap_refs, ceph_try_get_caps test for the
-EAGAIN twice. Ensure that it tests for -ESTALE instead.

Signed-off-by: Wu Bo <wubo40@huawei.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
  • Loading branch information
Wu Bo authored and Ilya Dryomov committed May 4, 2020
1 parent 0fa8263 commit 7d8976a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/ceph/caps.c
Original file line number Diff line number Diff line change
Expand Up @@ -2749,7 +2749,7 @@ int ceph_try_get_caps(struct inode *inode, int need, int want,

ret = try_get_cap_refs(inode, need, want, 0, flags, got);
/* three special error codes */
if (ret == -EAGAIN || ret == -EFBIG || ret == -EAGAIN)
if (ret == -EAGAIN || ret == -EFBIG || ret == -ESTALE)
ret = 0;
return ret;
}
Expand Down

0 comments on commit 7d8976a

Please sign in to comment.