summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYan, Zheng <zyan@redhat.com>2016-05-03 22:33:20 +0800
committerIlya Dryomov <idryomov@gmail.com>2016-05-26 01:15:37 +0200
commit421721195a68f46a8218c664154076b5b06f5f51 (patch)
tree199ad5827b30dbe81d4d8294facf531358e3f2e3
parenta407846ef7c6e7905ab0d1ebc0c86fbebb065b87 (diff)
downloadlwn-421721195a68f46a8218c664154076b5b06f5f51.tar.gz
lwn-421721195a68f46a8218c664154076b5b06f5f51.zip
ceph: fix dir_auth check in ceph_fill_dirfrag()
-1 is CDIR_AUTH_PARENT, it means dir's auth mds is the same as inode's auth mds Signed-off-by: Yan, Zheng <zyan@redhat.com>
-rw-r--r--fs/ceph/inode.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c
index d91eb6b49259..562f57d15f46 100644
--- a/fs/ceph/inode.c
+++ b/fs/ceph/inode.c
@@ -254,6 +254,9 @@ static int ceph_fill_dirfrag(struct inode *inode,
diri_auth = ci->i_auth_cap->mds;
spin_unlock(&ci->i_ceph_lock);
+ if (mds == -1) /* CDIR_AUTH_PARENT */
+ mds = diri_auth;
+
mutex_lock(&ci->i_fragtree_mutex);
if (ndist == 0 && mds == diri_auth) {
/* no delegation info needed. */