aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ceph/mds_client.c
diff options
context:
space:
mode:
authorYan, Zheng <zyan@redhat.com>2016-04-08 03:27:16 -0400
committerIlya Dryomov <idryomov@gmail.com>2016-05-25 19:15:31 -0400
commit77310320c299b0dc050037ff8fc29fd1861fb005 (patch)
tree04932e112c578f7f8dd982fd37df2366511b247e /fs/ceph/mds_client.c
parentd463a43d69f4af85887671d76182437775fd1631 (diff)
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,
1133 struct ceph_mds_client *mdsc = 1133 struct ceph_mds_client *mdsc =
1134 ceph_sb_to_client(inode->i_sb)->mdsc; 1134 ceph_sb_to_client(inode->i_sb)->mdsc;
1135 1135
1136 ci->i_ceph_flags |= CEPH_I_CAP_DROPPED;
1137
1136 while (true) { 1138 while (true) {
1137 struct rb_node *n = rb_first(&ci->i_cap_flush_tree); 1139 struct rb_node *n = rb_first(&ci->i_cap_flush_tree);
1138 if (!n) 1140 if (!n)
@@ -1181,7 +1183,9 @@ static int remove_session_caps_cb(struct inode *inode, struct ceph_cap *cap,
1181 list_del(&cf->list); 1183 list_del(&cf->list);
1182 ceph_free_cap_flush(cf); 1184 ceph_free_cap_flush(cf);
1183 } 1185 }
1184 while (drop--) 1186
1187 wake_up_all(&ci->i_cap_wq);
1188 if (drop)
1185 iput(inode); 1189 iput(inode);
1186 return 0; 1190 return 0;
1187} 1191}