From: Yan, Zheng Date: Tue, 10 Mar 2020 11:34:21 +0000 (+0800) Subject: ceph: wait for async creating inode before requesting new max size X-Git-Tag: v5.7-rc1~39^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9bccb76574ad9ba6f5868b09053179fa2e72f8e0;p=thirdparty%2Fkernel%2Flinux.git ceph: wait for async creating inode before requesting new max size 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. Also, wait for async creating reply before calling ceph_renew_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 be1ae4b92cfd3..185db76300b31 100644 --- a/fs/ceph/caps.c +++ b/fs/ceph/caps.c @@ -2833,6 +2833,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;