diff options
author | Yan, Zheng <zyan@redhat.com> | 2017-07-26 07:48:08 +0300 |
---|---|---|
committer | Ilya Dryomov <idryomov@gmail.com> | 2017-09-06 20:56:46 +0300 |
commit | 5d37ca1480a70f437e4c425ee5723c760cf6afac (patch) | |
tree | 8655991c60dc18e5ef228247fe3636373b713724 /fs/ceph/mds_client.c | |
parent | 8d45b911a9f106ec898ec531d5badba5df7c2748 (diff) | |
download | linux-5d37ca1480a70f437e4c425ee5723c760cf6afac.tar.xz |
ceph: send LSSNAP request to auth mds of directory inode
Snapdir inode has no capability. __choose_mds() should choose mds
base on capabilities of snapdir's parent inode.
Signed-off-by: "Yan, Zheng" <zyan@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Diffstat (limited to 'fs/ceph/mds_client.c')
-rw-r--r-- | fs/ceph/mds_client.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c index 666a9f274832..86ff74424df4 100644 --- a/fs/ceph/mds_client.c +++ b/fs/ceph/mds_client.c @@ -731,9 +731,16 @@ static int __choose_mds(struct ceph_mds_client *mdsc, inode = NULL; if (req->r_inode) { - inode = req->r_inode; - ihold(inode); - } else if (req->r_dentry) { + if (ceph_snap(req->r_inode) != CEPH_SNAPDIR) { + inode = req->r_inode; + ihold(inode); + } else { + /* req->r_dentry is non-null for LSSNAP request. + * fall-thru */ + WARN_ON_ONCE(!req->r_dentry); + } + } + if (!inode && req->r_dentry) { /* ignore race with rename; old or new d_parent is okay */ struct dentry *parent; struct inode *dir; |