From: Yan, Zheng Date: Fri, 18 Apr 2014 14:01:38 +0000 (+0800) Subject: ceph: remember subtree root dirfrag's auth MDS X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=8d08503c130e96e3794f66fe47053051460b1584;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git ceph: remember subtree root dirfrag's auth MDS remember dirfrag's auth MDS when it's different from its parent inode's auth MDS. Signed-off-by: Yan, Zheng --- diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c index 850b26d2e601..8b3da8adbbe3 100644 --- a/fs/ceph/inode.c +++ b/fs/ceph/inode.c @@ -245,11 +245,17 @@ static int ceph_fill_dirfrag(struct inode *inode, u32 id = le32_to_cpu(dirinfo->frag); int mds = le32_to_cpu(dirinfo->auth); int ndist = le32_to_cpu(dirinfo->ndist); + int diri_auth = -1; int i; int err = 0; + spin_lock(&ci->i_ceph_lock); + if (ci->i_auth_cap) + diri_auth = ci->i_auth_cap->mds; + spin_unlock(&ci->i_ceph_lock); + mutex_lock(&ci->i_fragtree_mutex); - if (ndist == 0) { + if (ndist == 0 && mds == diri_auth) { /* no delegation info needed. */ frag = __ceph_find_frag(ci, id); if (!frag)