From: Yan, Zheng Date: Sat, 8 Mar 2014 01:51:45 +0000 (+0800) Subject: ceph: make sure write caps are registered with auth MDS X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=a255060451dcb416c8097218b40d86d613d84bfc;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git 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 --- 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; }