Skip to content

Commit

Permalink
libceph: drop gratuitous socket close calls in con_work
Browse files Browse the repository at this point in the history
If the state is CLOSED or OPENING, we shouldn't have a socket.

Signed-off-by: Sage Weil <sage@inktank.com>
  • Loading branch information
Sage Weil committed Jul 31, 2012
1 parent a59b55a commit 2e8cb10
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions net/ceph/messenger.c
Original file line number Diff line number Diff line change
@@ -2284,15 +2284,15 @@ static void con_work(struct work_struct *work)
dout("con_work %p STANDBY\n", con);
goto done;
}
if (test_bit(CLOSED, &con->state)) { /* e.g. if we are replaced */
dout("con_work CLOSED\n");
con_close_socket(con);
if (test_bit(CLOSED, &con->state)) {
dout("con_work %p CLOSED\n", con);
BUG_ON(con->sock);
goto done;
}
if (test_and_clear_bit(OPENING, &con->state)) {
/* reopen w/ new peer */
dout("con_work OPENING\n");
con_close_socket(con);
BUG_ON(con->sock);
}

ret = try_read(con);

0 comments on commit 2e8cb10

Please sign in to comment.