From 42d70f8e31dfd3b795259b0d5c7ff4d4b45c24fd Mon Sep 17 00:00:00 2001 From: "Yan, Zheng" Date: Tue, 10 Mar 2020 19:34:19 +0800 Subject: 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 --- fs/ceph/caps.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'fs/ceph') diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c index 78a305068cac..086bb3adc08a 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; } /* -- cgit v1.2.3