This is a note to let you know that I've just added the patch titled

    libceph: fix protocol feature mismatch failure path

to the 3.7-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-protocol-feature-mismatch-failure-path.patch
and it can be found in the queue-3.7 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.


>From f10a18433a1b3192e71eecffeaeca5f5f1694016 Mon Sep 17 00:00:00 2001
From: Sage Weil <s...@inktank.com>
Date: Thu, 27 Dec 2012 20:27:04 -0600
Subject: libceph: fix protocol feature mismatch failure path


From: Sage Weil <s...@inktank.com>

(cherry picked from commit 0fa6ebc600bc8e830551aee47a0e929e818a1868)

We should not set con->state to CLOSED here; that happens in
ceph_fault() in the caller, where it first asserts that the state
is not yet CLOSED.  Avoids a BUG when the features don't match.

Since the fail_protocol() has become a trivial wrapper, replace
calls to it with direct calls to reset_connection().

Signed-off-by: Sage Weil <s...@inktank.com>
Reviewed-by: Alex Elder <el...@inktank.com>
Signed-off-by: Greg Kroah-Hartman <gre...@linuxfoundation.org>
---
 net/ceph/messenger.c |   14 ++++----------
 1 file changed, 4 insertions(+), 10 deletions(-)

--- a/net/ceph/messenger.c
+++ b/net/ceph/messenger.c
@@ -506,6 +506,7 @@ static void reset_connection(struct ceph
 {
        /* reset connection, out_queue, msg_ and connect_seq */
        /* discard existing out_queue and msg_seq */
+       dout("reset_connection %p\n", con);
        ceph_msg_remove_list(&con->out_queue);
        ceph_msg_remove_list(&con->out_sent);
 
@@ -1506,13 +1507,6 @@ static int process_banner(struct ceph_co
        return 0;
 }
 
-static void fail_protocol(struct ceph_connection *con)
-{
-       reset_connection(con);
-       WARN_ON(con->state != CON_STATE_NEGOTIATING);
-       con->state = CON_STATE_CLOSED;
-}
-
 static int process_connect(struct ceph_connection *con)
 {
        u64 sup_feat = con->msgr->supported_features;
@@ -1530,7 +1524,7 @@ static int process_connect(struct ceph_c
                       ceph_pr_addr(&con->peer_addr.in_addr),
                       sup_feat, server_feat, server_feat & ~sup_feat);
                con->error_msg = "missing required protocol features";
-               fail_protocol(con);
+               reset_connection(con);
                return -1;
 
        case CEPH_MSGR_TAG_BADPROTOVER:
@@ -1541,7 +1535,7 @@ static int process_connect(struct ceph_c
                       le32_to_cpu(con->out_connect.protocol_version),
                       le32_to_cpu(con->in_reply.protocol_version));
                con->error_msg = "protocol version mismatch";
-               fail_protocol(con);
+               reset_connection(con);
                return -1;
 
        case CEPH_MSGR_TAG_BADAUTHORIZER:
@@ -1631,7 +1625,7 @@ static int process_connect(struct ceph_c
                               ceph_pr_addr(&con->peer_addr.in_addr),
                               req_feat, server_feat, req_feat & ~server_feat);
                        con->error_msg = "missing required protocol features";
-                       fail_protocol(con);
+                       reset_connection(con);
                        return -1;
                }
 


Patches currently in stable-queue which might be from s...@inktank.com are

queue-3.7/ceph-fix-__ceph_do_pending_vmtruncate.patch
queue-3.7/libceph-remove-osdtimeout-option.patch
queue-3.7/0007-libceph-move-linger-requests-sooner-in-kick_requests.patch
queue-3.7/ceph-don-t-reference-req-after-put.patch
queue-3.7/libceph-fix-osdmap-decode-error-paths.patch
queue-3.7/libceph-fix-protocol-feature-mismatch-failure-path.patch
queue-3.7/rbd-do-not-allow-remove-of-mounted-on-image.patch
queue-3.7/ceph-don-t-update-i_max_size-when-handling-non-auth-cap.patch
queue-3.7/ceph-call-handle_cap_grant-for-cap-import-message.patch
queue-3.7/ceph-fix-infinite-loop-in-__wake_requests.patch
queue-3.7/0009-libceph-WARN-don-t-BUG-on-unexpected-connection-stat.patch
queue-3.7/0005-libceph-don-t-use-rb_init_node-in-ceph_osdc_alloc_re.patch
queue-3.7/0004-libceph-init-event-node-in-ceph_osdc_create_event.patch
queue-3.7/rbd-remove-linger-unconditionally.patch
queue-3.7/0008-libceph-always-reset-osds-when-kicking.patch
queue-3.7/libceph-avoid-using-freed-osd-in-__kick_osd_requests.patch
queue-3.7/0002-libceph-report-connection-fault-with-warning.patch
queue-3.7/0003-libceph-init-osd-o_node-in-create_osd.patch
queue-3.7/0001-libceph-socket-can-close-in-any-connection-state.patch
queue-3.7/ceph-don-t-add-dirty-inode-to-dirty-list-if-caps-is-in-migration.patch
queue-3.7/0006-libceph-register-request-before-unregister-linger.patch
queue-3.7/rbd-get-rid-of-rbd_max_seg_name_len.patch
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to