summaryrefslogtreecommitdiff
path: root/fs/ceph/mds_client.c
diff options
context:
space:
mode:
authorYan, Zheng <zyan@redhat.com>2016-04-08 07:27:16 (GMT)
committerIlya Dryomov <idryomov@gmail.com>2016-05-25 23:15:31 (GMT)
commit77310320c299b0dc050037ff8fc29fd1861fb005 (patch)
tree04932e112c578f7f8dd982fd37df2366511b247e /fs/ceph/mds_client.c
parentd463a43d69f4af85887671d76182437775fd1631 (diff)
downloadlinux-77310320c299b0dc050037ff8fc29fd1861fb005.tar.xz
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 cff85af..1e5965d 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;
}