This is a note to let you know that I've just added the patch titled
libceph: fix safe completion
to the 3.10-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
libceph-fix-safe-completion.patch
and it can be found in the queue-3.10 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <[email protected]> know about it.
>From eb845ff13a44477f8a411baedbf11d678b9daf0a Mon Sep 17 00:00:00 2001
From: "Yan, Zheng" <[email protected]>
Date: Fri, 31 May 2013 15:54:44 +0800
Subject: libceph: fix safe completion
From: "Yan, Zheng" <[email protected]>
commit eb845ff13a44477f8a411baedbf11d678b9daf0a upstream.
handle_reply() calls complete_request() only if the first OSD reply
has ONDISK flag.
Signed-off-by: Yan, Zheng <[email protected]>
Reviewed-by: Sage Weil <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
include/linux/ceph/osd_client.h | 1 -
net/ceph/osd_client.c | 17 ++++++++---------
2 files changed, 8 insertions(+), 10 deletions(-)
--- a/include/linux/ceph/osd_client.h
+++ b/include/linux/ceph/osd_client.h
@@ -145,7 +145,6 @@ struct ceph_osd_request {
s32 r_reply_op_result[CEPH_OSD_MAX_OP];
int r_got_reply;
int r_linger;
- int r_completed;
struct ceph_osd_client *r_osdc;
struct kref r_kref;
--- a/net/ceph/osd_client.c
+++ b/net/ceph/osd_client.c
@@ -1522,6 +1522,8 @@ static void handle_reply(struct ceph_osd
for (i = 0; i < numops; i++)
req->r_reply_op_result[i] = ceph_decode_32(&p);
+ already_completed = req->r_got_reply;
+
if (!req->r_got_reply) {
req->r_result = result;
@@ -1552,16 +1554,14 @@ static void handle_reply(struct ceph_osd
((flags & CEPH_OSD_FLAG_WRITE) == 0))
__unregister_request(osdc, req);
- already_completed = req->r_completed;
- req->r_completed = 1;
mutex_unlock(&osdc->request_mutex);
- if (already_completed)
- goto done;
- if (req->r_callback)
- req->r_callback(req, msg);
- else
- complete_all(&req->r_completion);
+ if (!already_completed) {
+ if (req->r_callback)
+ req->r_callback(req, msg);
+ else
+ complete_all(&req->r_completion);
+ }
if (flags & CEPH_OSD_FLAG_ONDISK)
complete_request(req);
@@ -2121,7 +2121,6 @@ int ceph_osdc_start_request(struct ceph_
__register_request(osdc, req);
req->r_sent = 0;
req->r_got_reply = 0;
- req->r_completed = 0;
rc = __map_request(osdc, req, 0);
if (rc < 0) {
if (nofail) {
Patches currently in stable-queue which might be from [email protected] are
queue-3.10/libceph-fix-safe-completion.patch
queue-3.10/ceph-wake-up-safe-waiters-when-unregistering-request.patch
queue-3.10/libceph-fix-truncate-size-calculation.patch
queue-3.10/ceph-cleanup-aborted-requests-when-re-sending-requests.patch
queue-3.10/ceph-fix-bugs-about-handling-short-read-for-sync-read-mode.patch
queue-3.10/libceph-call-r_unsafe_callback-when-unsafe-reply-is-received.patch
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html