Re: [PATCH] sd: error handling during flushing caches

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 16 Sep 2013 oliver@xxxxxxxxxx wrote:

> From: Oliver Neukum <oneukum@xxxxxxx>
> 
> 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 <oneukum@xxxxxxx>

Acked-by: Alan Stern <stern@xxxxxxxxxxxxxxxxxxx>

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 majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux