Skip to contentSkip to conversation

ceph: wake up 'safe' waiters when unregistering request

PATCH In review Yan, Zheng 2 participants 2 messages Oct 31, 2013 Ceph client

lore
Share & tools
lore

Yan, Zheng

author
#0 lore raw

PATCH 1/1 ceph: wake up 'safe' waiters when unregistering request

From: "Yan, Zheng" <[email protected]>

We also need to wake up 'safe' waiters if error occurs or request aborted. Otherwise sync(2)/fsync(2) may hang forever.

---
 fs/ceph/mds_client.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
fs/ceph/mds_client.c +2 -1
index 8ef7926..cb6a7ae 100644
@@ -643,6 +643,8 @@ static void __unregister_request(struct ceph_mds_client *mdsc,
 		iput(req->r_unsafe_dir);
 		req->r_unsafe_dir = NULL;
 	}
+	
+	complete_all(&req->r_safe_completion);
 
 	ceph_mdsc_put_request(req);
 }
@@ -2186,7 +2188,6 @@ static void handle_reply(struct ceph_mds_session *session, struct ceph_msg *msg)
 	if (head->safe) {
 		req->r_got_safe = true;
 		__unregister_request(mdsc, req);
-		complete_all(&req->r_safe_completion);
 
 		if (req->r_got_unsafe) {
 			/*
Signature · 1 line
1.8.1.4
#1 lore raw

Applied this to the testing branch. Thanks!

sage

Quoted 35 lines · Zheng

From: "Yan, Zheng" <[email protected]>

We also need to wake up 'safe' waiters if error occurs or request aborted. Otherwise sync(2)/fsync(2) may hang forever.

---
 fs/ceph/mds_client.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
fs/ceph/mds_client.c +2 -1
index 8ef7926..cb6a7ae 100644
@@ -643,6 +643,8 @@ static void __unregister_request(struct ceph_mds_client *mdsc,
 		iput(req->r_unsafe_dir);
 		req->r_unsafe_dir = NULL;
 	}
+	
+	complete_all(&req->r_safe_completion);
 
 	ceph_mdsc_put_request(req);
 }
@@ -2186,7 +2188,6 @@ static void handle_reply(struct ceph_mds_session *session, struct ceph_msg *msg)
 	if (head->safe) {
 		req->r_got_safe = true;
 		__unregister_request(mdsc, req);
-		complete_all(&req->r_safe_completion);
 
 		if (req->r_got_unsafe) {
 			/*
Signature · 1 line
1.8.1.4