diff options
author | Yan, Zheng <zheng.z.yan@intel.com> | 2014-04-18 10:01:38 -0400 |
---|---|---|
committer | Yan, Zheng <zheng.z.yan@intel.com> | 2014-06-05 21:29:55 -0400 |
commit | 8d08503c130e96e3794f66fe47053051460b1584 (patch) | |
tree | bdfa7be3a04c5ce36684f1ac900ad204c4f80c57 /fs/ceph | |
parent | 3e7fbe9cebfdaac380419507908e10c499ddd25b (diff) |
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 <zheng.z.yan@intel.com>
Diffstat (limited to 'fs/ceph')
-rw-r--r-- | fs/ceph/inode.c | 8 |
1 files changed, 7 insertions, 1 deletions
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, | |||
245 | u32 id = le32_to_cpu(dirinfo->frag); | 245 | u32 id = le32_to_cpu(dirinfo->frag); |
246 | int mds = le32_to_cpu(dirinfo->auth); | 246 | int mds = le32_to_cpu(dirinfo->auth); |
247 | int ndist = le32_to_cpu(dirinfo->ndist); | 247 | int ndist = le32_to_cpu(dirinfo->ndist); |
248 | int diri_auth = -1; | ||
248 | int i; | 249 | int i; |
249 | int err = 0; | 250 | int err = 0; |
250 | 251 | ||
252 | spin_lock(&ci->i_ceph_lock); | ||
253 | if (ci->i_auth_cap) | ||
254 | diri_auth = ci->i_auth_cap->mds; | ||
255 | spin_unlock(&ci->i_ceph_lock); | ||
256 | |||
251 | mutex_lock(&ci->i_fragtree_mutex); | 257 | mutex_lock(&ci->i_fragtree_mutex); |
252 | if (ndist == 0) { | 258 | if (ndist == 0 && mds == diri_auth) { |
253 | /* no delegation info needed. */ | 259 | /* no delegation info needed. */ |
254 | frag = __ceph_find_frag(ci, id); | 260 | frag = __ceph_find_frag(ci, id); |
255 | if (!frag) | 261 | if (!frag) |