summaryrefslogtreecommitdiff
path: root/fs/ceph/caps.c
diff options
context:
space:
mode:
authorYan, Zheng <zheng.z.yan@intel.com>2014-03-08 09:51:45 +0800
committerSage Weil <sage@inktank.com>2014-04-04 21:07:05 -0700
commita255060451dcb416c8097218b40d86d613d84bfc (patch)
treec3dc990fc565b01d586041093d007e4493c2a7f4 /fs/ceph/caps.c
parentc137a32a408af7a5635f3d0c5ddd34d270af9a3b (diff)
ceph: make sure write caps are registered with auth MDS
Only auth MDS can issue write caps to clients, so don't consider write caps registered with non-auth MDS as valid. Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
Diffstat (limited to 'fs/ceph/caps.c')
-rw-r--r--fs/ceph/caps.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c
index 17543383545c..d9ef44e5474e 100644
--- a/fs/ceph/caps.c
+++ b/fs/ceph/caps.c
@@ -885,7 +885,10 @@ int __ceph_caps_mds_wanted(struct ceph_inode_info *ci)
cap = rb_entry(p, struct ceph_cap, ci_node);
if (!__cap_is_valid(cap))
continue;
- mds_wanted |= cap->mds_wanted;
+ if (cap == ci->i_auth_cap)
+ mds_wanted |= cap->mds_wanted;
+ else
+ mds_wanted |= (cap->mds_wanted & ~CEPH_CAP_ANY_FILE_WR);
}
return mds_wanted;
}