From: Wu Bo Date: Wed, 29 Apr 2020 02:01:55 +0000 (+0800) Subject: ceph: fix special error code in ceph_try_get_caps() X-Git-Tag: v5.7-rc5~16^2~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7d8976afad18d4548ee472e526b126ab74012807;p=thirdparty%2Fkernel%2Flinux.git ceph: fix special error code in ceph_try_get_caps() 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 Reviewed-by: Jeff Layton Signed-off-by: Ilya Dryomov --- diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c index 185db76300b31..1a8e20ef35bf6 100644 --- a/fs/ceph/caps.c +++ b/fs/ceph/caps.c @@ -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; }