From c9e6fa5ca9c05f23e036e904c398998569a885c0 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Mon, 30 Dec 2013 21:15:21 -0800 Subject: [PATCH] 3.4-stable patches added patches: ceph-cleanup-aborted-requests-when-re-sending-requests.patch ceph-wake-up-safe-waiters-when-unregistering-request.patch --- ...ed-requests-when-re-sending-requests.patch | 37 ++++++++++++++++++ ...e-waiters-when-unregistering-request.patch | 39 +++++++++++++++++++ queue-3.4/series | 2 + 3 files changed, 78 insertions(+) create mode 100644 queue-3.4/ceph-cleanup-aborted-requests-when-re-sending-requests.patch create mode 100644 queue-3.4/ceph-wake-up-safe-waiters-when-unregistering-request.patch diff --git a/queue-3.4/ceph-cleanup-aborted-requests-when-re-sending-requests.patch b/queue-3.4/ceph-cleanup-aborted-requests-when-re-sending-requests.patch new file mode 100644 index 00000000000..d3baa62eb13 --- /dev/null +++ b/queue-3.4/ceph-cleanup-aborted-requests-when-re-sending-requests.patch @@ -0,0 +1,37 @@ +From eb1b8af33c2e42a9a57fc0a7588f4a7b255d2e79 Mon Sep 17 00:00:00 2001 +From: "Yan, Zheng" +Date: Thu, 26 Sep 2013 14:25:36 +0800 +Subject: ceph: cleanup aborted requests when re-sending requests. + +From: "Yan, Zheng" + +commit eb1b8af33c2e42a9a57fc0a7588f4a7b255d2e79 upstream. + +Aborted requests usually get cleared when the reply is received. +If MDS crashes, no reply will be received. So we need to cleanup +aborted requests when re-sending requests. + +Signed-off-by: Yan, Zheng +Reviewed-by: Greg Farnum +Signed-off-by: Sage Weil +Signed-off-by: Greg Kroah-Hartman + +--- + fs/ceph/mds_client.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +--- a/fs/ceph/mds_client.c ++++ b/fs/ceph/mds_client.c +@@ -1815,8 +1815,11 @@ static int __do_request(struct ceph_mds_ + int mds = -1; + int err = -EAGAIN; + +- if (req->r_err || req->r_got_result) ++ if (req->r_err || req->r_got_result) { ++ if (req->r_aborted) ++ __unregister_request(mdsc, req); + goto out; ++ } + + if (req->r_timeout && + time_after_eq(jiffies, req->r_started + req->r_timeout)) { diff --git a/queue-3.4/ceph-wake-up-safe-waiters-when-unregistering-request.patch b/queue-3.4/ceph-wake-up-safe-waiters-when-unregistering-request.patch new file mode 100644 index 00000000000..31c5b10d527 --- /dev/null +++ b/queue-3.4/ceph-wake-up-safe-waiters-when-unregistering-request.patch @@ -0,0 +1,39 @@ +From fc55d2c9448b34218ca58733a6f51fbede09575b Mon Sep 17 00:00:00 2001 +From: "Yan, Zheng" +Date: Thu, 31 Oct 2013 09:10:47 +0800 +Subject: ceph: wake up 'safe' waiters when unregistering request + +From: "Yan, Zheng" + +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 +Signed-off-by: Sage Weil +Signed-off-by: Greg Kroah-Hartman + +--- + 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 +@@ -609,6 +609,8 @@ static void __unregister_request(struct + req->r_unsafe_dir = NULL; + } + ++ complete_all(&req->r_safe_completion); ++ + ceph_mdsc_put_request(req); + } + +@@ -2132,7 +2134,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) { + /* diff --git a/queue-3.4/series b/queue-3.4/series index f351a020bbc..b4f10addfcc 100644 --- a/queue-3.4/series +++ b/queue-3.4/series @@ -1 +1,3 @@ usb-serial-fix-race-in-generic-write.patch +ceph-cleanup-aborted-requests-when-re-sending-requests.patch +ceph-wake-up-safe-waiters-when-unregistering-request.patch -- 2.47.3