summaryrefslogtreecommitdiffstats
path: root/fs/ceph/caps.c
diff options
context:
space:
mode:
authorYan, Zheng <zyan@redhat.com>2020-03-10 19:34:21 +0800
committerIlya Dryomov <idryomov@gmail.com>2020-03-30 12:42:43 +0200
commit9bccb76574ad9ba6f5868b09053179fa2e72f8e0 (patch)
treead5104af7210e20f0bfbcf82c45e06cd4935d7d2 /fs/ceph/caps.c
parent0aa971b6fd3f92afef6afe24ef78d9bb14471519 (diff)
downloadlinux-9bccb76574ad9ba6f5868b09053179fa2e72f8e0.tar.gz
linux-9bccb76574ad9ba6f5868b09053179fa2e72f8e0.tar.bz2
linux-9bccb76574ad9ba6f5868b09053179fa2e72f8e0.zip
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" <zyan@redhat.com> Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Diffstat (limited to 'fs/ceph/caps.c')
-rw-r--r--fs/ceph/caps.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c
index be1ae4b92cfd..185db76300b3 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;