diff options
author | Yan, Zheng <zyan@redhat.com> | 2017-05-15 20:55:34 -0400 |
---|---|---|
committer | Ilya Dryomov <idryomov@gmail.com> | 2017-07-07 11:25:12 -0400 |
commit | 84eea8c79090c44564877cd47c73455e32ec4846 (patch) | |
tree | 6ac69a8fb4b084b7a046adc4bf41ed56316fe82a /fs/ceph/caps.c | |
parent | 6f7da290413ba713f0cdd9ff1a2a9bb129ef4f6c (diff) |
ceph: re-request max size after importing caps
The 'wanted max size' could be sent to inode's old auth mds, re-send
it to inode's new auth mds if necessary. Otherwise write syscall may
hang.
Signed-off-by: "Yan, Zheng" <zyan@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Diffstat (limited to 'fs/ceph/caps.c')
-rw-r--r-- | fs/ceph/caps.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c index a3ebb632294e..6752223dc81c 100644 --- a/fs/ceph/caps.c +++ b/fs/ceph/caps.c | |||
@@ -3027,8 +3027,10 @@ static void handle_cap_grant(struct ceph_mds_client *mdsc, | |||
3027 | le32_to_cpu(grant->truncate_seq), | 3027 | le32_to_cpu(grant->truncate_seq), |
3028 | le64_to_cpu(grant->truncate_size), | 3028 | le64_to_cpu(grant->truncate_size), |
3029 | size); | 3029 | size); |
3030 | /* max size increase? */ | 3030 | } |
3031 | if (ci->i_auth_cap == cap && max_size != ci->i_max_size) { | 3031 | |
3032 | if (ci->i_auth_cap == cap && (newcaps & CEPH_CAP_ANY_FILE_WR)) { | ||
3033 | if (max_size != ci->i_max_size) { | ||
3032 | dout("max_size %lld -> %llu\n", | 3034 | dout("max_size %lld -> %llu\n", |
3033 | ci->i_max_size, max_size); | 3035 | ci->i_max_size, max_size); |
3034 | ci->i_max_size = max_size; | 3036 | ci->i_max_size = max_size; |
@@ -3037,6 +3039,10 @@ static void handle_cap_grant(struct ceph_mds_client *mdsc, | |||
3037 | ci->i_requested_max_size = 0; | 3039 | ci->i_requested_max_size = 0; |
3038 | } | 3040 | } |
3039 | wake = true; | 3041 | wake = true; |
3042 | } else if (ci->i_wanted_max_size > ci->i_max_size && | ||
3043 | ci->i_wanted_max_size > ci->i_requested_max_size) { | ||
3044 | /* CEPH_CAP_OP_IMPORT */ | ||
3045 | wake = true; | ||
3040 | } | 3046 | } |
3041 | } | 3047 | } |
3042 | 3048 | ||
@@ -3554,7 +3560,6 @@ retry: | |||
3554 | } | 3560 | } |
3555 | 3561 | ||
3556 | /* make sure we re-request max_size, if necessary */ | 3562 | /* make sure we re-request max_size, if necessary */ |
3557 | ci->i_wanted_max_size = 0; | ||
3558 | ci->i_requested_max_size = 0; | 3563 | ci->i_requested_max_size = 0; |
3559 | 3564 | ||
3560 | *old_issued = issued; | 3565 | *old_issued = issued; |