From: Yan, Zheng Date: Tue, 10 Mar 2020 11:34:19 +0000 (+0800) Subject: ceph: request new max size only when there is auth cap X-Git-Tag: v5.7-rc1~39^2~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=42d70f8e31dfd3b795259b0d5c7ff4d4b45c24fd;p=thirdparty%2Fkernel%2Flinux.git ceph: request new max size only when there is auth cap When there is no auth cap, check_max_size() can't do anything and may cause an infinite loop inside ceph_get_caps(). Signed-off-by: "Yan, Zheng" Reviewed-by: Jeff Layton Signed-off-by: Ilya Dryomov --- diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c index 78a305068cacd..086bb3adc08a0 100644 --- a/fs/ceph/caps.c +++ b/fs/ceph/caps.c @@ -2582,7 +2582,7 @@ again: dout("get_cap_refs %p endoff %llu > maxsize %llu\n", inode, endoff, ci->i_max_size); if (endoff > ci->i_requested_max_size) - ret = -EFBIG; + ret = ci->i_auth_cap ? -EFBIG : -ESTALE; goto out_unlock; } /*