Skip to content

Commit

Permalink
libceph: SOCK_CLOSED is a flag, not a state
Browse files Browse the repository at this point in the history
The following commit changed it so SOCK_CLOSED bit was stored in
a connection's new "flags" field rather than its "state" field.

    libceph: start separating connection flags from state
    commit 928443c

That bit is used in con_close_socket() to protect against setting an
error message more than once in the socket event handler function.

Unfortunately, the field being operated on in that function was not
updated to be "flags" as it should have been.  This fixes that
error.

Signed-off-by: Alex Elder <elder@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
  • Loading branch information
Alex Elder authored and Sage Weil committed Jul 6, 2012
1 parent abdaa6a commit a8d00e3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions net/ceph/messenger.c
Original file line number Diff line number Diff line change
Expand Up @@ -397,11 +397,11 @@ static int con_close_socket(struct ceph_connection *con)
dout("con_close_socket on %p sock %p\n", con, con->sock);
if (!con->sock)
return 0;
set_bit(SOCK_CLOSED, &con->state);
set_bit(SOCK_CLOSED, &con->flags);
rc = con->sock->ops->shutdown(con->sock, SHUT_RDWR);
sock_release(con->sock);
con->sock = NULL;
clear_bit(SOCK_CLOSED, &con->state);
clear_bit(SOCK_CLOSED, &con->flags);
con_sock_state_closed(con);
return rc;
}
Expand Down

0 comments on commit a8d00e3

Please sign in to comment.