Commit 8d08503c authored by Yan, Zheng's avatar Yan, Zheng

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: default avatarYan, Zheng <zheng.z.yan@intel.com>
parent 3e7fbe9c
...@@ -245,11 +245,17 @@ static int ceph_fill_dirfrag(struct inode *inode, ...@@ -245,11 +245,17 @@ static int ceph_fill_dirfrag(struct inode *inode,
u32 id = le32_to_cpu(dirinfo->frag); u32 id = le32_to_cpu(dirinfo->frag);
int mds = le32_to_cpu(dirinfo->auth); int mds = le32_to_cpu(dirinfo->auth);
int ndist = le32_to_cpu(dirinfo->ndist); int ndist = le32_to_cpu(dirinfo->ndist);
int diri_auth = -1;
int i; int i;
int err = 0; 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); mutex_lock(&ci->i_fragtree_mutex);
if (ndist == 0) { if (ndist == 0 && mds == diri_auth) {
/* no delegation info needed. */ /* no delegation info needed. */
frag = __ceph_find_frag(ci, id); frag = __ceph_find_frag(ci, id);
if (!frag) if (!frag)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment