Skip to contentSkip to conversation

SCSI: fix the return value of scsi_target_queue_read()

PATCH New [email protected] 1 participant 1 message Dec 16, 2010 SCSI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 SCSI: fix the return value of scsi_target_queue_read()

From: Hillf Danton <[email protected]>

It seems that zero should be returned if scsi_target_is_busy(starget) is true, no matter if sdev is on the starved list.

---
 drivers/scsi/scsi_lib.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)
drivers/scsi/scsi_lib.c +2 -3
index 5b6bbae..0ed7a66 100644
@@ -1278,11 +1278,10 @@ static inline int scsi_target_queue_ready(struct Scsi_Host *shost,
 	}
 
 	if (scsi_target_is_busy(starget)) {
-		if (list_empty(&sdev->starved_entry)) {
+		if (list_empty(&sdev->starved_entry))
 			list_add_tail(&sdev->starved_entry,
 				      &shost->starved_list);
-			return 0;
-		}
+		return 0;
 	}
 
 	/* We're OK to process the command, so we can't be starved */
Signature · 1 line
1.7.2.3