[SCSI] iscsi: fix writepsace race

We can race and misset the suspend bit if iscsi_write_space is
called then iscsi_send returns with a failure indicating
there is no space.

To handle this this patch returns a error upwards allowing xmitworker
to decide if we need to try and transmit again. For the no
write space case xmitworker will not retry, and instead
let iscsi_write_space queue it back up if needed (this relies
on the work queue code to properly requeue us if needed).

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
This commit is contained in:
Mike Christie
2006-05-30 00:37:28 -05:00
committed by James Bottomley
parent 040515f53c
commit 3219e52941
3 changed files with 126 additions and 95 deletions

View File

@@ -57,8 +57,12 @@ struct iscsi_mgmt_task;
* Called from queuecommand with session lock held.
* @init_mgmt_task: Initialize a iscsi_mgmt_task and any internal structs.
* Called from iscsi_conn_send_generic with xmitmutex.
* @xmit_cmd_task: requests LLD to transfer cmd task
* @xmit_mgmt_task: requests LLD to transfer mgmt task
* @xmit_cmd_task: Requests LLD to transfer cmd task. Returns 0 or the
* the number of bytes transferred on success, and -Exyz
* value on error.
* @xmit_mgmt_task: Requests LLD to transfer mgmt task. Returns 0 or the
* the number of bytes transferred on success, and -Exyz
* value on error.
* @cleanup_cmd_task: requests LLD to fail cmd task. Called with xmitmutex
* and session->lock after the connection has been
* suspended and terminated during recovery. If called