Skip to content

Commit

Permalink
ceph: wait for async creating inode before requesting new max size
Browse files Browse the repository at this point in the history
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" <[email protected]>
Reviewed-by: Jeff Layton <[email protected]>
Signed-off-by: Ilya Dryomov <[email protected]>
  • Loading branch information
ukernel authored and idryomov committed Mar 30, 2020
1 parent 0aa971b commit 9bccb76
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions fs/ceph/caps.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 9bccb76

Please sign in to comment.