summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYan, Zheng <zheng.z.yan@intel.com>2013-01-04 15:30:10 +0800
committerAlex Elder <elder@inktank.com>2013-01-17 12:42:38 -0600
commit390306c38dd43908f7f7730229999790a773d1d5 (patch)
tree29906b1efa684636dd2dac23bc9954a5290ec868
parent66f58691c5c820283dd7e4d6fe8649033ed43ceb (diff)
downloadlinux-390306c38dd43908f7f7730229999790a773d1d5.tar.bz2
ceph: check mds_wanted for imported cap
The MDS may have incorrect wanted caps after importing caps. So the client should check the value mds has and send cap update if necessary. Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com> Reviewed-by: Sage Weil <sage@inktank.com>
-rw-r--r--fs/ceph/caps.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c
index 40b5bbe63a39..1e1e02055a2b 100644
--- a/fs/ceph/caps.c
+++ b/fs/ceph/caps.c
@@ -2429,7 +2429,9 @@ static void handle_cap_grant(struct inode *inode, struct ceph_mds_caps *grant,
dout("mds wanted %s -> %s\n",
ceph_cap_string(le32_to_cpu(grant->wanted)),
ceph_cap_string(wanted));
- grant->wanted = cpu_to_le32(wanted);
+ /* imported cap may not have correct mds_wanted */
+ if (le32_to_cpu(grant->op) == CEPH_CAP_OP_IMPORT)
+ check_caps = 1;
}
cap->seq = seq;