On Mon, 16 Sep 2013 [email protected] wrote:

> From: Oliver Neukum <[email protected]>
> 
> It makes no sense to flush the cache of a device without medium.
> Errors during suspend must be handled according to their causes.
> Errors due to missing media or unplugged devices must be ignored.
> Errors due to devices being offlined must also be ignored.
> The error returns must be modified so that the generic layer
> understands them.
> 
> Signed-off-by: Oliver Neukum <[email protected]>

Acked-by: Alan Stern <[email protected]>

You might want to change the formatting slightly...

> @@ -1448,12 +1448,31 @@ static int sd_sync_cache(struct scsi_disk *sdkp)
>  
>       if (res) {
>               sd_print_result(sdkp, res);
> -             if (driver_byte(res) & DRIVER_SENSE)
> +
> +             if (driver_byte(res) & DRIVER_SENSE) 
>                       sd_print_sense_hdr(sdkp, &sshdr);
> +             /* we need to evaluate the error return  */
> +             if ((scsi_sense_valid(&sshdr) &&
> +                     /* 0x3a is medium not present */
> +                     sshdr.asc == 0x3a))
> +                             /* this is no error here */
> +                             return 0;

There's a superfluous pair of parens in the "if" condition.  The same 
is true for the statement added to sd_start_stop_device().

Also, the indentation levels aren't quite right (the "return" statement
should be indented by only one additional tab stop, not two).

Of course, these are both extremely minor objections.

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to