Skip to content

Commit

Permalink
libceph: clear messenger auth_retry flag if we fault
Browse files Browse the repository at this point in the history
Commit 20e55c4 ("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>
  • Loading branch information
Ilya Dryomov committed Jan 21, 2016
1 parent 67645d7 commit f6330cc
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions net/ceph/messenger.c
Original file line number Diff line number Diff line change
Expand Up @@ -2827,13 +2827,17 @@ static bool con_backoff(struct ceph_connection *con)

static void con_fault_finish(struct ceph_connection *con)
{
dout("%s %p\n", __func__, con);

/*
* in case we faulted due to authentication, invalidate our
* current tickets so that we can get new ones.
*/
if (con->auth_retry && con->ops->invalidate_authorizer) {
dout("calling invalidate_authorizer()\n");
con->ops->invalidate_authorizer(con);
if (con->auth_retry) {
dout("auth_retry %d, invalidating\n", con->auth_retry);
if (con->ops->invalidate_authorizer)
con->ops->invalidate_authorizer(con);
con->auth_retry = 0;
}

if (con->ops->fault)
Expand Down

0 comments on commit f6330cc

Please sign in to comment.