aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ceph
diff options
context:
space:
mode:
authorYan, Zheng <zheng.z.yan@intel.com>2012-11-18 21:49:09 -0500
committerAlex Elder <elder@inktank.com>2012-12-13 09:13:08 -0500
commit0e5e1774a92e6fe9c511585de8f078b4c4c68dbb (patch)
treeafae65bdcf42f8eddbd906c4038c6c67249b626b /fs/ceph
parenta85f50b6ef93fbbb2ae932ce9b2376509d172796 (diff)
ceph: call handle_cap_grant() for cap import message
If client sends cap message that requests new max size during exporting caps, the exporting MDS will drop the message quietly. So the client may wait for the reply that updates the max size forever. call handle_cap_grant() for cap import message can avoid this issue. Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com> Signed-off-by: Sage Weil <sage@inktank.com>
Diffstat (limited to 'fs/ceph')
-rw-r--r--fs/ceph/caps.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c
index 5efa3f5e2f77..a1d9bb30c1bf 100644
--- a/fs/ceph/caps.c
+++ b/fs/ceph/caps.c
@@ -2751,6 +2751,7 @@ static void handle_cap_import(struct ceph_mds_client *mdsc,
2751 2751
2752 /* make sure we re-request max_size, if necessary */ 2752 /* make sure we re-request max_size, if necessary */
2753 spin_lock(&ci->i_ceph_lock); 2753 spin_lock(&ci->i_ceph_lock);
2754 ci->i_wanted_max_size = 0; /* reset */
2754 ci->i_requested_max_size = 0; 2755 ci->i_requested_max_size = 0;
2755 spin_unlock(&ci->i_ceph_lock); 2756 spin_unlock(&ci->i_ceph_lock);
2756} 2757}
@@ -2846,8 +2847,6 @@ void ceph_handle_caps(struct ceph_mds_session *session,
2846 case CEPH_CAP_OP_IMPORT: 2847 case CEPH_CAP_OP_IMPORT:
2847 handle_cap_import(mdsc, inode, h, session, 2848 handle_cap_import(mdsc, inode, h, session,
2848 snaptrace, snaptrace_len); 2849 snaptrace, snaptrace_len);
2849 ceph_check_caps(ceph_inode(inode), 0, session);
2850 goto done_unlocked;
2851 } 2850 }
2852 2851
2853 /* the rest require a cap */ 2852 /* the rest require a cap */
@@ -2864,6 +2863,7 @@ void ceph_handle_caps(struct ceph_mds_session *session,
2864 switch (op) { 2863 switch (op) {
2865 case CEPH_CAP_OP_REVOKE: 2864 case CEPH_CAP_OP_REVOKE:
2866 case CEPH_CAP_OP_GRANT: 2865 case CEPH_CAP_OP_GRANT:
2866 case CEPH_CAP_OP_IMPORT:
2867 handle_cap_grant(inode, h, session, cap, msg->middle); 2867 handle_cap_grant(inode, h, session, cap, msg->middle);
2868 goto done_unlocked; 2868 goto done_unlocked;
2869 2869