aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIlya Dryomov <idryomov@gmail.com>2016-01-13 08:32:57 -0500
committerIlya Dryomov <idryomov@gmail.com>2016-01-21 13:36:08 -0500
commitf6330cc1f04b7dcb84b572d402cdacf7e275a022 (patch)
treec6460bb777e8be11bf521ff5624fb4159b06c512
parent67645d7619738e51c668ca69f097cb90b5470422 (diff)
libceph: clear messenger auth_retry flag if we fault
Commit 20e55c4cc758 ("libceph: clear messenger auth_retry flag when we authenticate") got us only half way there. We clear the flag if the second attempt succeeds, but it also needs to be cleared if that attempt fails, to allow for the exponential backoff to kick in. Otherwise, if ->should_authenticate() thinks our keys are valid, we will busy loop, incrementing auth_retry to no avail: process_connect ffff880079a63830 got BADAUTHORIZER attempt 1 process_connect ffff880079a63830 got BADAUTHORIZER attempt 2 process_connect ffff880079a63830 got BADAUTHORIZER attempt 3 process_connect ffff880079a63830 got BADAUTHORIZER attempt 4 process_connect ffff880079a63830 got BADAUTHORIZER attempt 5 ... Signed-off-by: Ilya Dryomov <idryomov@gmail.com> Reviewed-by: Sage Weil <sage@redhat.com>
-rw-r--r--net/ceph/messenger.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c
index 3850d1a5bd7c..9cfedf565f5b 100644
--- a/net/ceph/messenger.c
+++ b/net/ceph/messenger.c
@@ -2827,13 +2827,17 @@ static bool con_backoff(struct ceph_connection *con)
2827 2827
2828static void con_fault_finish(struct ceph_connection *con) 2828static void con_fault_finish(struct ceph_connection *con)
2829{ 2829{
2830 dout("%s %p\n", __func__, con);
2831
2830 /* 2832 /*
2831 * in case we faulted due to authentication, invalidate our 2833 * in case we faulted due to authentication, invalidate our
2832 * current tickets so that we can get new ones. 2834 * current tickets so that we can get new ones.
2833 */ 2835 */
2834 if (con->auth_retry && con->ops->invalidate_authorizer) { 2836 if (con->auth_retry) {
2835 dout("calling invalidate_authorizer()\n"); 2837 dout("auth_retry %d, invalidating\n", con->auth_retry);
2836 con->ops->invalidate_authorizer(con); 2838 if (con->ops->invalidate_authorizer)
2839 con->ops->invalidate_authorizer(con);
2840 con->auth_retry = 0;
2837 } 2841 }
2838 2842
2839 if (con->ops->fault) 2843 if (con->ops->fault)