aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYan, Zheng <zyan@redhat.com>2017-09-21 23:41:06 -0400
committerIlya Dryomov <idryomov@gmail.com>2017-10-02 10:18:16 -0400
commit38f340ccdf9ed5f1350505b46c5689d015967057 (patch)
tree23fd6ca51606fdf6481977bb1e81fa9cba446619
parent9f4057fc937f200f000dbc378c5c3e37d45e31dc (diff)
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: "Yan, Zheng" <zyan@redhat.com> Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
-rw-r--r--fs/ceph/mds_client.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c
index 84edfc60d87a..f23c820daaed 100644
--- a/fs/ceph/mds_client.c
+++ b/fs/ceph/mds_client.c
@@ -734,12 +734,13 @@ static int __choose_mds(struct ceph_mds_client *mdsc,
734 inode = req->r_inode; 734 inode = req->r_inode;
735 ihold(inode); 735 ihold(inode);
736 } else { 736 } else {
737 /* req->r_dentry is non-null for LSSNAP request. 737 /* req->r_dentry is non-null for LSSNAP request */
738 * fall-thru */ 738 rcu_read_lock();
739 WARN_ON_ONCE(!req->r_dentry); 739 inode = get_nonsnap_parent(req->r_dentry);
740 rcu_read_unlock();
741 dout("__choose_mds using snapdir's parent %p\n", inode);
740 } 742 }
741 } 743 } else if (req->r_dentry) {
742 if (!inode && req->r_dentry) {
743 /* ignore race with rename; old or new d_parent is okay */ 744 /* ignore race with rename; old or new d_parent is okay */
744 struct dentry *parent; 745 struct dentry *parent;
745 struct inode *dir; 746 struct inode *dir;