diff mbox series

[2/4] ceph: request new max size only when there is auth cap

Message ID 20200310113421.174873-3-zyan@redhat.com (mailing list archive)
State New, archived
Headers show
Series fix ceph_get_caps() bugs | expand

Commit Message

Yan, Zheng March 10, 2020, 11:34 a.m. UTC
When there is no auth cap, check_max_size() can't do anything, may
cause infinite loop inside ceph_get_caps().

Signed-off-by: "Yan, Zheng" <zyan@redhat.com>
---
 fs/ceph/caps.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c
index 804f4c65251a..295b61201d85 100644
--- a/fs/ceph/caps.c
+++ b/fs/ceph/caps.c
@@ -2582,7 +2582,7 @@  static int try_get_cap_refs(struct inode *inode, int need, int want,
 			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;
 		}
 		/*