diff mbox series

[4/4] ceph: wait for async creating inode before requesting new max size

Message ID 20200310113421.174873-5-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
ceph_check_caps() can't request new max size for async creating inode.
This may make ceph_get_caps() loop busily until getting reply of the
async create.

This patch also waits for async creating inode before calling
ceph_renew_caps()

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

Patch

diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c
index f63db3cb9c4f..14bedf2c16cd 100644
--- a/fs/ceph/caps.c
+++ b/fs/ceph/caps.c
@@ -2832,6 +2832,11 @@  int ceph_get_caps(struct file *filp, int need, int want,
 		}
 
 		if (ret < 0) {
+			if (ret == -EFBIG || ret == -ESTALE) {
+				int ret2 = ceph_wait_on_async_create(inode);
+				if (ret2 < 0)
+					return ret2;
+			}
 			if (ret == -EFBIG) {
 				check_max_size(inode, endoff);
 				continue;