Skip to content

Commit 38f340c

Browse files
ukernelidryomov
authored andcommitted
ceph: fix __choose_mds() for LSSNAP request
previous commit 5d37ca1 "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>
1 parent 9f4057f commit 38f340c

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

fs/ceph/mds_client.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -734,12 +734,13 @@ static int __choose_mds(struct ceph_mds_client *mdsc,
734734
inode = req->r_inode;
735735
ihold(inode);
736736
} else {
737-
/* req->r_dentry is non-null for LSSNAP request.
738-
* fall-thru */
739-
WARN_ON_ONCE(!req->r_dentry);
737+
/* req->r_dentry is non-null for LSSNAP request */
738+
rcu_read_lock();
739+
inode = get_nonsnap_parent(req->r_dentry);
740+
rcu_read_unlock();
741+
dout("__choose_mds using snapdir's parent %p\n", inode);
740742
}
741-
}
742-
if (!inode && req->r_dentry) {
743+
} else if (req->r_dentry) {
743744
/* ignore race with rename; old or new d_parent is okay */
744745
struct dentry *parent;
745746
struct inode *dir;

0 commit comments

Comments
 (0)