Commit 38f340cc authored by Yan, Zheng's avatar Yan, Zheng Committed by Ilya Dryomov

ceph: fix __choose_mds() for LSSNAP request

previous commit 5d37ca14 "ceph: send LSSNAP request to auth mds
of directory inode" is buggy. It makes __choose_mds() choose mds
base on hash of '.snap' dentry.
Signed-off-by: default avatar"Yan, Zheng" <zyan@redhat.com>
Signed-off-by: default avatarIlya Dryomov <idryomov@gmail.com>
parent 9f4057fc
...@@ -734,12 +734,13 @@ static int __choose_mds(struct ceph_mds_client *mdsc, ...@@ -734,12 +734,13 @@ static int __choose_mds(struct ceph_mds_client *mdsc,
inode = req->r_inode; inode = req->r_inode;
ihold(inode); ihold(inode);
} else { } else {
/* req->r_dentry is non-null for LSSNAP request. /* req->r_dentry is non-null for LSSNAP request */
* fall-thru */ rcu_read_lock();
WARN_ON_ONCE(!req->r_dentry); inode = get_nonsnap_parent(req->r_dentry);
rcu_read_unlock();
dout("__choose_mds using snapdir's parent %p\n", inode);
} }
} } else if (req->r_dentry) {
if (!inode && req->r_dentry) {
/* ignore race with rename; old or new d_parent is okay */ /* ignore race with rename; old or new d_parent is okay */
struct dentry *parent; struct dentry *parent;
struct inode *dir; struct inode *dir;
......
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