Skip to contentSkip to conversation

Is scsi_reset_provider() overdoing it?

PATCH Boaz Harrosh 1 participant 1 message Jul 3, 2007 SCSI

lore
Share & tools
lore
#0 lore raw

In scsi_error.c at scsi_reset_provider()
Why do we need the uninitialized struct request hanging on the reset scsi_cmnd? It looks like we are bypassing block queues and directly going to llds. It also looks like llds understand not to touch any garbage request's fields during reset. Would it not be better to Just put a NULL instead? And while at it can I just put a DMA_NONE on this No-Data command?

Boaz

drivers/scsi/scsi_error.c +2 -3
index 9adb64a..4f6026d 100644
@@ -1662,11 +1662,10 @@ 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;
+	scmd->request = NULL;
 	memset(&scmd->eh_timeout, 0, sizeof(scmd->eh_timeout));
 
 	memset(&scmd->cmnd, '\0', sizeof(scmd->cmnd));
@@ -1678,7 +1677,7 @@ scsi_reset_provider(struct scsi_device *dev, int flag)
 
 	scmd->cmd_len			= 0;
 
-	scmd->sc_data_direction		= DMA_BIDIRECTIONAL;
+	scmd->sc_data_direction		= DMA_NONE;
 
 	init_timer(&scmd->eh_timeout);