Re: [usb-storage] [PATCH]indistinguishable devices with broken and unbroken firmware

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

 



On Wed, 7 Feb 2007, Oliver Neukum wrote:

> --- a/drivers/scsi/sd.c	2007-02-06 14:14:48.000000000 +0100
> +++ b/drivers/scsi/sd.c	2007-02-07 15:14:01.000000000 +0100
> @@ -1273,6 +1273,13 @@
>  	if (sdp->fix_capacity)
>  		--sdkp->capacity;
>  
> +	/* Some devices have version which report the correct sizes
> +	 * and others which do not. We guess size according to a heuristic
> +	 * and err on the side of lowering the capacity. */
> +	if (sdp->guess_capacity)
> +		if (sdkp->capacity & 0x01) /* odd sizes are odd */
> +			--sdkp->capacity;

Please make this "else if ...".  Just in case somebody ever manages to set 
both sdp->fix_capacity and sdp->guess_capacity.

Otherwise it looks reasonable to me.

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