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.

Signed-off-by: Yan, Zheng <[email protected]>
---
 fs/ceph/mds_client.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c
index 8ef7926..cb6a7ae 100644
--- a/fs/ceph/mds_client.c
+++ b/fs/ceph/mds_client.c
@@ -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) {
                        /*
-- 
1.8.1.4

--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to