Re: Suggested patch for testing last sector of USB devices

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

 



Alan Stern wrote:
> --- usb-2.6.orig/include/scsi/scsi_device.h
> +++ usb-2.6/include/scsi/scsi_device.h
> @@ -142,6 +142,7 @@ struct scsi_device {
>  	unsigned select_no_atn:1;
>  	unsigned fix_capacity:1;	/* READ_CAPACITY is too high by 1 */
>  	unsigned guess_capacity:1;	/* READ_CAPACITY might be too high by 1 */
> +	unsigned check_capacity:1;	/* Verify READ_CAPACITY result */

Maybe add "ignored if no USB_STORAGE support is built" to the comment
since it is a no-op otherwise:

> --- usb-2.6.orig/drivers/scsi/sd.c
> +++ usb-2.6/drivers/scsi/sd.c
> @@ -1275,6 +1275,88 @@ disable:
>  	sdkp->capacity = 0;
>  }
>  
> +#if defined(CONFIG_USB_STORAGE) || defined(CONFIG_USB_STORAGE_MODULE)
> +/*
> + * Test disk capacity by trying to read the last sector
> + */
> +static int sd_read_last_sector(struct scsi_disk *sdkp, unsigned char *buffer,
> +		int sector_size)
> +{
...
> +#else
> +static inline int sd_read_last_sector(struct scsi_disk *sdkp,
> +		unsigned char *buffer, int sector_size)
> +{
> +	return 0;
> +}
> +
> +#endif /* defined(CONFIG_USB_STORAGE) || ... */

-- 
Stefan Richter
-=====-==--- ==-- =-=-=
http://arcgraph.de/sr/
--
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