]> git.hungrycats.org Git - linux/commitdiff
libceph: clear messenger auth_retry flag when we authenticate
authorSage Weil <sage@inktank.com>
Mon, 25 Mar 2013 16:30:13 +0000 (09:30 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 20 Jun 2013 19:01:31 +0000 (12:01 -0700)
commit 20e55c4cc758e4dccdfd92ae8e9588dd624b2cd7 upstream.

We maintain a counter of failed auth attempts to allow us to retry once
before failing.  However, if the second attempt succeeds, the flag isn't
cleared, which makes us think auth failed again later when the connection
resets for other reasons (like a socket error).

This is one part of the sorry sequence of events in bug

http://tracker.ceph.com/issues/4282

Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Alex Elder <elder@inktank.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/ceph/messenger.c

index 2c0669fb54e33181f2834ea6725dd15291ec5a64..096e09fece9470da5e4f385dd2ed3350eca2dbd9 100644 (file)
@@ -1597,7 +1597,6 @@ static int process_connect(struct ceph_connection *con)
                        con->error_msg = "connect authorization failure";
                        return -1;
                }
-               con->auth_retry = 1;
                con_out_kvec_reset(con);
                ret = prepare_write_connect(con);
                if (ret < 0)
@@ -1682,7 +1681,7 @@ static int process_connect(struct ceph_connection *con)
 
                WARN_ON(con->state != CON_STATE_NEGOTIATING);
                con->state = CON_STATE_OPEN;
-
+               con->auth_retry = 0;    /* we authenticated; clear flag */
                con->peer_global_seq = le32_to_cpu(con->in_reply.global_seq);
                con->connect_seq++;
                con->peer_features = server_feat;