[PATCH 3.2 29/79] ceph: wake up 'safe' waiters when unregistering request

From: Ben Hutchings
Date: Wed Feb 12 2014 - 03:19:42 EST


3.2.55-rc1 review patch. If anyone has any objections, please let me know.

------------------

From: "Yan, Zheng" <zheng.z.yan@xxxxxxxxx>

commit fc55d2c9448b34218ca58733a6f51fbede09575b upstream.

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@xxxxxxxxx>
Signed-off-by: Sage Weil <sage@xxxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
Signed-off-by: Ben Hutchings <ben@xxxxxxxxxxxxxxx>
---
fs/ceph/mds_client.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

--- a/fs/ceph/mds_client.c
+++ b/fs/ceph/mds_client.c
@@ -608,6 +608,8 @@ static void __unregister_request(struct
req->r_unsafe_dir = NULL;
}

+ complete_all(&req->r_safe_completion);
+
ceph_mdsc_put_request(req);
}

@@ -2127,7 +2129,6 @@ static void handle_reply(struct ceph_mds
if (head->safe) {
req->r_got_safe = true;
__unregister_request(mdsc, req);
- complete_all(&req->r_safe_completion);

if (req->r_got_unsafe) {
/*

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/