Re: Patch "sd: Disable support for 256 byte/sector disks" has been added to the 4.0-stable tree

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

 



On 06/03/2015, 08:35 AM, gregkh@xxxxxxxxxxxxxxxxxxx wrote:
> From 74856fbf441929918c49ff262ace9835048e4e6a Mon Sep 17 00:00:00 2001
> From: Mark Hounschell <dmarkh@xxxxxxxxxx>
> Date: Wed, 13 May 2015 10:49:09 +0200
> Subject: sd: Disable support for 256 byte/sector disks
> 
> From: Mark Hounschell <dmarkh@xxxxxxxxxx>
> 
> commit 74856fbf441929918c49ff262ace9835048e4e6a upstream.
> 
> 256 bytes per sector support has been broken since 2.6.X,
> and no-one stepped up to fix this.
> So disable support for it.
> 
> Signed-off-by: Mark Hounschell <dmarkh@xxxxxxxxxx>
> Signed-off-by: Hannes Reinecke <hare@xxxxxxx>
> Signed-off-by: James Bottomley <JBottomley@xxxxxxxx>
> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
> 
> ---
>  drivers/scsi/sd.c |   19 +++++--------------
>  1 file changed, 5 insertions(+), 14 deletions(-)
> 
> --- a/drivers/scsi/sd.c
> +++ b/drivers/scsi/sd.c
> @@ -1624,6 +1624,7 @@ static unsigned int sd_completed_bytes(s
>  {
>  	u64 start_lba = blk_rq_pos(scmd->request);
>  	u64 end_lba = blk_rq_pos(scmd->request) + (scsi_bufflen(scmd) / 512);
> +	u64 factor = scmd->device->sector_size / 512;
>  	u64 bad_lba;
>  	int info_valid;
>  	/*
> @@ -1645,16 +1646,9 @@ static unsigned int sd_completed_bytes(s
>  	if (scsi_bufflen(scmd) <= scmd->device->sector_size)
>  		return 0;
>  
> -	if (scmd->device->sector_size < 512) {
> -		/* only legitimate sector_size here is 256 */
> -		start_lba <<= 1;
> -		end_lba <<= 1;
> -	} else {
> -		/* be careful ... don't want any overflows */
> -		unsigned int factor = scmd->device->sector_size / 512;
> -		do_div(start_lba, factor);
> -		do_div(end_lba, factor);
> -	}

Hmm, you do 'unsigned int' -> 'u64' switch of factor type here. But this
commit:
commit ef80d1e18b014af08741cf688e3fdda1fb71363f
Author: Geert Uytterhoeven <geert@xxxxxxxxxxxxxx>
Date:   Mon Nov 4 10:21:05 2013 +0100

    [SCSI] sd: Do not call do_div() with a 64-bit divisor

did the switch in the opposite direction deliberately.

So why did you do the change, given sector_size is uint?

thanks,
-- 
js
suse labs
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]