summaryrefslogtreecommitdiffstats
path: root/fs/ceph/mds_client.c
diff options
context:
space:
mode:
authorYan, Zheng2016-04-08 09:27:16 +0200
committerIlya Dryomov2016-05-26 01:15:31 +0200
commit77310320c299b0dc050037ff8fc29fd1861fb005 (patch)
tree04932e112c578f7f8dd982fd37df2366511b247e /fs/ceph/mds_client.c
parentceph: CEPH_FEATURE_MDSENC support (diff)
downloadkernel-qcow2-linux-77310320c299b0dc050037ff8fc29fd1861fb005.tar.gz
kernel-qcow2-linux-77310320c299b0dc050037ff8fc29fd1861fb005.tar.xz
kernel-qcow2-linux-77310320c299b0dc050037ff8fc29fd1861fb005.zip
ceph: renew caps for read/write if mds session got killed.
When mds session gets killed, read/write operation may hang. Client waits for Frw caps, but mds does not know what caps client wants. To recover this, client sends an open request to mds. The request will tell mds what caps client wants. Signed-off-by: Yan, Zheng <zyan@redhat.com>
Diffstat (limited to 'fs/ceph/mds_client.c')
-rw-r--r--fs/ceph/mds_client.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c
index cff85af425d4..1e5965d17cb1 100644
--- a/fs/ceph/mds_client.c
+++ b/fs/ceph/mds_client.c
@@ -1133,6 +1133,8 @@ static int remove_session_caps_cb(struct inode *inode, struct ceph_cap *cap,
struct ceph_mds_client *mdsc =
ceph_sb_to_client(inode->i_sb)->mdsc;
+ ci->i_ceph_flags |= CEPH_I_CAP_DROPPED;
+
while (true) {
struct rb_node *n = rb_first(&ci->i_cap_flush_tree);
if (!n)
@@ -1181,7 +1183,9 @@ static int remove_session_caps_cb(struct inode *inode, struct ceph_cap *cap,
list_del(&cf->list);
ceph_free_cap_flush(cf);
}
- while (drop--)
+
+ wake_up_all(&ci->i_cap_wq);
+ if (drop)
iput(inode);
return 0;
}