login.c: dont modify pdu->flags directly from iscsi_logout_async_internal
We no longer need to modify pdu->flags directly any more from iscsi_logout_async_internal. We can just pass these as extra flags to iscsi_allocate_pdu(). We also always set ISCSI_PDU_DROP_ON_RECONNECT unconditionally so there is no need to pass this flag in from the callers in pdu.c . Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
This commit is contained in:
@@ -1127,7 +1127,7 @@ iscsi_logout_async_internal(struct iscsi_context *iscsi, iscsi_command_cb cb,
|
||||
ISCSI_PDU_LOGOUT_REQUEST,
|
||||
ISCSI_PDU_LOGOUT_RESPONSE,
|
||||
iscsi_itt_post_increment(iscsi),
|
||||
ISCSI_PDU_DROP_ON_RECONNECT);
|
||||
ISCSI_PDU_DROP_ON_RECONNECT|ISCSI_PDU_CORK_WHEN_SENT|flags);
|
||||
if (pdu == NULL) {
|
||||
iscsi_set_error(iscsi, "Out-of-memory: Failed to allocate "
|
||||
"logout pdu.");
|
||||
@@ -1149,7 +1149,6 @@ iscsi_logout_async_internal(struct iscsi_context *iscsi, iscsi_command_cb cb,
|
||||
|
||||
pdu->callback = cb;
|
||||
pdu->private_data = private_data;
|
||||
pdu->flags |= ISCSI_PDU_CORK_WHEN_SENT | flags;
|
||||
|
||||
if (iscsi_queue_pdu(iscsi, pdu) != 0) {
|
||||
iscsi_set_error(iscsi, "Out-of-memory: failed to queue iscsi "
|
||||
|
||||
@@ -365,7 +365,7 @@ int iscsi_process_reject(struct iscsi_context *iscsi,
|
||||
|
||||
if (reason == ISCSI_REJECT_WAITING_FOR_LOGOUT) {
|
||||
ISCSI_LOG(iscsi, 1, "target rejects request with reason: %s", iscsi_reject_reason_str(reason));
|
||||
iscsi_logout_async_internal(iscsi, iscsi_reconnect_after_logout, NULL, ISCSI_PDU_DROP_ON_RECONNECT|ISCSI_PDU_URGENT_DELIVERY);
|
||||
iscsi_logout_async_internal(iscsi, iscsi_reconnect_after_logout, NULL, ISCSI_PDU_URGENT_DELIVERY);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -435,7 +435,7 @@ iscsi_process_pdu(struct iscsi_context *iscsi, struct iscsi_in_pdu *in)
|
||||
ISCSI_LOG(iscsi, 2, "dropping connection to fix errors with broken DELL Equallogic firmware 7.x");
|
||||
return -1;
|
||||
}
|
||||
iscsi_logout_async_internal(iscsi, iscsi_reconnect_after_logout, NULL, ISCSI_PDU_DROP_ON_RECONNECT|ISCSI_PDU_URGENT_DELIVERY);
|
||||
iscsi_logout_async_internal(iscsi, iscsi_reconnect_after_logout, NULL, ISCSI_PDU_URGENT_DELIVERY);
|
||||
return 0;
|
||||
case 0x2:
|
||||
ISCSI_LOG(iscsi, 2, "target will drop this connection. Time2Wait is %u seconds", param2);
|
||||
|
||||
Reference in New Issue
Block a user