diff mbox

[01/17] scsi_dh: return individual errors in scsi_dh_activate()

Message ID 1430743343-47174-2-git-send-email-hare@suse.de (mailing list archive)
State New, archived
Headers show

Commit Message

Hannes Reinecke May 4, 2015, 12:42 p.m. UTC
When calling scsi_dh_activate() we should be returning
individual errors and not lumping all into one.

Signed-off-by: Hannes Reinecke <hare@suse.de>
---
 drivers/scsi/device_handler/scsi_dh.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Bart Van Assche May 7, 2015, 11:34 a.m. UTC | #1
On 05/04/15 14:42, Hannes Reinecke wrote:
> When calling scsi_dh_activate() we should be returning
> individual errors and not lumping all into one.
>
> Signed-off-by: Hannes Reinecke <hare@suse.de>
> ---
>   drivers/scsi/device_handler/scsi_dh.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/scsi/device_handler/scsi_dh.c b/drivers/scsi/device_handler/scsi_dh.c
> index 155abeab..a4afd30 100644
> --- a/drivers/scsi/device_handler/scsi_dh.c
> +++ b/drivers/scsi/device_handler/scsi_dh.c
> @@ -315,9 +315,10 @@ int scsi_dh_activate(struct request_queue *q, activate_complete fn, void *data)
>
>   	if (!sdev->handler)
>   		goto out_fn;
> +	err = SCSI_DH_NOTCONN;
>   	if (sdev->sdev_state == SDEV_CANCEL ||
>   	    sdev->sdev_state == SDEV_DEL)
> -	    	goto out_fn;
> +		goto out_fn;
>
>   	err = SCSI_DH_DEV_OFFLINED;
>   	if (sdev->sdev_state == SDEV_OFFLINE)
>

Reviewed-by: Bart Van Assche <bart.vanassche@sandisk.com>
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Christoph Hellwig May 11, 2015, 6:34 a.m. UTC | #2
On Mon, May 04, 2015 at 02:42:07PM +0200, Hannes Reinecke wrote:
> When calling scsi_dh_activate() we should be returning
> individual errors and not lumping all into one.

Looks good,

Reviewed-by: Christoph Hellwig <hch@lst.de>

(although you might need a rebase, my v2 post has some white space changes
that git-am complained about, sorry)
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/scsi/device_handler/scsi_dh.c b/drivers/scsi/device_handler/scsi_dh.c
index 155abeab..a4afd30 100644
--- a/drivers/scsi/device_handler/scsi_dh.c
+++ b/drivers/scsi/device_handler/scsi_dh.c
@@ -315,9 +315,10 @@  int scsi_dh_activate(struct request_queue *q, activate_complete fn, void *data)
 
 	if (!sdev->handler)
 		goto out_fn;
+	err = SCSI_DH_NOTCONN;
 	if (sdev->sdev_state == SDEV_CANCEL ||
 	    sdev->sdev_state == SDEV_DEL)
-	    	goto out_fn;
+		goto out_fn;
 
 	err = SCSI_DH_DEV_OFFLINED;
 	if (sdev->sdev_state == SDEV_OFFLINE)