ceph: wake up 'safe' waiters when unregistering request
authorYan, Zheng <zheng.z.yan@intel.com>
Thu, 31 Oct 2013 01:10:47 +0000 (09:10 +0800)
committerSage Weil <sage@inktank.com>
Sat, 23 Nov 2013 19:01:05 +0000 (11:01 -0800)
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 <zheng.z.yan@intel.com>
Signed-off-by: Sage Weil <sage@inktank.com>
fs/ceph/mds_client.c

index 8ef79266d0645651b03465c72314bb6129f95d56..d90861f452107cc47b7242e8ea66dc1257f7c235 100644 (file)
@@ -644,6 +644,8 @@ static void __unregister_request(struct ceph_mds_client *mdsc,
                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) {
                        /*