ceph: fix special error code in ceph_try_get_caps()
authorWu Bo <wubo40@huawei.com>
Wed, 29 Apr 2020 02:01:55 +0000 (10:01 +0800)
committerIlya Dryomov <idryomov@gmail.com>
Mon, 4 May 2020 17:14:23 +0000 (19:14 +0200)
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>
fs/ceph/caps.c

index 185db76300b31c2d71a68fa6065752620d32689d..1a8e20ef35bf6fd15ef7e78fe2f8c8f1fa79f098 100644 (file)
@@ -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;
 }