The patch titled Block I/O while SG reset operation in progress - the midlayer patch has been added to the -mm tree. Its filename is block-i-o-while-sg-reset-operation-in-progress-midlayer.patch See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find out what to do about this ------------------------------------------------------ Subject: Block I/O while SG reset operation in progress - the midlayer patch From: James Smart <James.Smart@xxxxxxxxxx> The scsi midlayer portion of the patch Signed-off-by: James Smart <James.Smart@xxxxxxxxxx> Cc: James Bottomley <James.Bottomley@xxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxx> --- drivers/scsi/scsi_error.c | 22 ++++++++++++++++++++++ include/scsi/scsi_host.h | 6 +++++- 2 files changed, 27 insertions(+), 1 deletion(-) diff -puN drivers/scsi/scsi_error.c~block-i-o-while-sg-reset-operation-in-progress-midlayer drivers/scsi/scsi_error.c --- 25/drivers/scsi/scsi_error.c~block-i-o-while-sg-reset-operation-in-progress-midlayer Tue Jun 27 14:44:15 2006 +++ 25-akpm/drivers/scsi/scsi_error.c Tue Jun 27 14:44:15 2006 @@ -1672,7 +1672,9 @@ int scsi_reset_provider(struct scsi_device *dev, int flag) { struct scsi_cmnd *scmd = scsi_get_command(dev, GFP_KERNEL); + struct Scsi_Host *shost = dev->host; struct request req; + unsigned long flags; int rtn; scmd->request = &req; @@ -1699,6 +1701,10 @@ scsi_reset_provider(struct scsi_device * */ scmd->pid = 0; + spin_lock_irqsave(shost->host_lock, flags); + shost->tmf_in_progress = 1; + spin_unlock_irqrestore(shost->host_lock, flags); + switch (flag) { case SCSI_TRY_RESET_DEVICE: rtn = scsi_try_bus_device_reset(scmd); @@ -1717,6 +1723,22 @@ scsi_reset_provider(struct scsi_device * rtn = FAILED; } + spin_lock_irqsave(shost->host_lock, flags); + shost->tmf_in_progress = 0; + spin_unlock_irqrestore(shost->host_lock, flags); + + /* + * be sure to wake up anyone who was sleeping or had their queue + * suspended while we performed the TMF. + */ + SCSI_LOG_ERROR_RECOVERY(3, + printk("%s: waking up host to restart after TMF\n", + __FUNCTION__)); + + wake_up(&shost->host_wait); + + scsi_run_host_queues(shost); + scsi_next_command(scmd); return rtn; } diff -puN include/scsi/scsi_host.h~block-i-o-while-sg-reset-operation-in-progress-midlayer include/scsi/scsi_host.h --- 25/include/scsi/scsi_host.h~block-i-o-while-sg-reset-operation-in-progress-midlayer Tue Jun 27 14:44:15 2006 +++ 25-akpm/include/scsi/scsi_host.h Tue Jun 27 14:44:15 2006 @@ -542,6 +542,9 @@ struct Scsi_Host { */ unsigned ordered_tag:1; + /* task mgmt function in progress */ + unsigned tmf_in_progress:1; + /* * Optional work queue to be utilized by the transport */ @@ -619,7 +622,8 @@ static inline int scsi_host_in_recovery( { return shost->shost_state == SHOST_RECOVERY || shost->shost_state == SHOST_CANCEL_RECOVERY || - shost->shost_state == SHOST_DEL_RECOVERY; + shost->shost_state == SHOST_DEL_RECOVERY || + shost->tmf_in_progress; } extern int scsi_queue_work(struct Scsi_Host *, struct work_struct *); _ Patches currently in -mm which might be from James.Smart@xxxxxxxxxx are git-scsi-misc.patch fc-transport-bug-fix-correct-references.patch scsi-midlayer-fix-sdev-reuse-after-free.patch block-i-o-while-sg-reset-operation-in-progress-midlayer.patch block-i-o-while-sg-reset-operation-in-progress-lpfc.patch fc-transport-resolve-scan-vs-delete-deadlocks.patch - To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html