isns: Fix endless loop when pollhup is returned
From: Mike Christie <mchristi@redhat.com>
If we are trying to send data, but get a POLLHUP we get
stuck in a endless loop. The problem is that the isns
socket handling for POLLHUP only clears the POLLIN bit, so
when we do this check:
/* No more input and output means closed&dead */
if (sock->is_state == ISNS_SOCK_IDLE
&& !(sock->is_poll_mask & (POLLIN|POLLOUT))) {
isns_debug_socket("connection closed by peer,
killing socket\n");
isns_net_close(sock, ISNS_SOCK_FAILED);
}
the POLLOUT bit is still set and we never are able to close the old
socket and reconnect a new one or fail or pass the status to the
caller.
This patch has the pollhup callout clear the POLLOUT bit.