On 05/30/2012 02:34 PM, Alex Elder wrote:
In con_close_socket(), SOCK_CLOSED is set in the connection state, then cleared again after shutting down the socket. Nothing between the setting and clearing of that bit will ever be affected by it, so there's no point in setting/clearing it at all. So don't. Signed-off-by: Alex Elder <elder@xxxxxxxxxxx>
I am retracting this proposed change. I believe it's possible for the con->sock->ops->shutdown() call to trigger a TCP_CLOSE socket state change event, which means that there *is* something that can be affected by that state bit being set. -Alex
--- net/ceph/messenger.c | 2 -- 1 files changed, 0 insertions(+), 2 deletions(-) diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c index 07af994..fe3c2a1 100644 --- a/net/ceph/messenger.c +++ b/net/ceph/messenger.c @@ -338,11 +338,9 @@ 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); rc = con->sock->ops->shutdown(con->sock, SHUT_RDWR); sock_release(con->sock); con->sock = NULL; - clear_bit(SOCK_CLOSED, &con->state); return rc; }
-- To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html