* [PATCH] sd: Disable support for 256 byte/sector disks
@ 2015-05-13 8:49 Hannes Reinecke
2015-05-13 12:55 ` Mark Hounschell
2015-05-13 14:00 ` James Bottomley
0 siblings, 2 replies; 6+ messages in thread
From: Hannes Reinecke @ 2015-05-13 8:49 UTC (permalink / raw)
To: James Bottomley
Cc: Mark Hounschell, linux-scsi, Christoph Hellwig, Hannes Reinecke
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@cfl.rr.com>
Signed-off-by: Hannes Reinecke <hare@suse.de>
---
drivers/scsi/sd.c | 19 +++++--------------
1 file changed, 5 insertions(+), 14 deletions(-)
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index 79beebf..7f9d65f 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -1600,6 +1600,7 @@ static unsigned int sd_completed_bytes(struct scsi_cmnd *scmd)
{
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;
/*
@@ -1621,16 +1622,9 @@ static unsigned int sd_completed_bytes(struct scsi_cmnd *scmd)
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);
- }
+ /* be careful ... don't want any overflows */
+ do_div(start_lba, factor);
+ do_div(end_lba, factor);
/* The bad lba was reported incorrectly, we have no idea where
* the error is.
@@ -2188,8 +2182,7 @@ got_data:
if (sector_size != 512 &&
sector_size != 1024 &&
sector_size != 2048 &&
- sector_size != 4096 &&
- sector_size != 256) {
+ sector_size != 4096) {
sd_printk(KERN_NOTICE, sdkp, "Unsupported sector size %d.\n",
sector_size);
/*
@@ -2244,8 +2237,6 @@ got_data:
sdkp->capacity <<= 2;
else if (sector_size == 1024)
sdkp->capacity <<= 1;
- else if (sector_size == 256)
- sdkp->capacity >>= 1;
blk_queue_physical_block_size(sdp->request_queue,
sdkp->physical_block_size);
--
1.8.5.2
^ permalink raw reply related [flat|nested] 6+ messages in thread* Re: [PATCH] sd: Disable support for 256 byte/sector disks
2015-05-13 8:49 [PATCH] sd: Disable support for 256 byte/sector disks Hannes Reinecke
@ 2015-05-13 12:55 ` Mark Hounschell
2015-05-13 14:00 ` James Bottomley
1 sibling, 0 replies; 6+ messages in thread
From: Mark Hounschell @ 2015-05-13 12:55 UTC (permalink / raw)
To: Hannes Reinecke, James Bottomley
Cc: Mark Hounschell, linux-scsi, Christoph Hellwig
On 05/13/2015 04:49 AM, Hannes Reinecke wrote:
> 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@cfl.rr.com>
> Signed-off-by: Hannes Reinecke <hare@suse.de>
> ---
> drivers/scsi/sd.c | 19 +++++--------------
> 1 file changed, 5 insertions(+), 14 deletions(-)
>
> diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
> index 79beebf..7f9d65f 100644
> --- a/drivers/scsi/sd.c
> +++ b/drivers/scsi/sd.c
> @@ -1600,6 +1600,7 @@ static unsigned int sd_completed_bytes(struct scsi_cmnd *scmd)
> {
> 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;
> /*
> @@ -1621,16 +1622,9 @@ static unsigned int sd_completed_bytes(struct scsi_cmnd *scmd)
> 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);
> - }
> + /* be careful ... don't want any overflows */
> + do_div(start_lba, factor);
> + do_div(end_lba, factor);
>
> /* The bad lba was reported incorrectly, we have no idea where
> * the error is.
> @@ -2188,8 +2182,7 @@ got_data:
> if (sector_size != 512 &&
> sector_size != 1024 &&
> sector_size != 2048 &&
> - sector_size != 4096 &&
> - sector_size != 256) {
> + sector_size != 4096) {
> sd_printk(KERN_NOTICE, sdkp, "Unsupported sector size %d.\n",
> sector_size);
> /*
> @@ -2244,8 +2237,6 @@ got_data:
> sdkp->capacity <<= 2;
> else if (sector_size == 1024)
> sdkp->capacity <<= 1;
> - else if (sector_size == 256)
> - sdkp->capacity >>= 1;
>
> blk_queue_physical_block_size(sdp->request_queue,
> sdkp->physical_block_size);
>
Tested-by: Mark Hounschell <dmarkh@cfl.rr.com>
Mark
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH] sd: Disable support for 256 byte/sector disks
2015-05-13 8:49 [PATCH] sd: Disable support for 256 byte/sector disks Hannes Reinecke
2015-05-13 12:55 ` Mark Hounschell
@ 2015-05-13 14:00 ` James Bottomley
2015-05-13 14:09 ` Hannes Reinecke
1 sibling, 1 reply; 6+ messages in thread
From: James Bottomley @ 2015-05-13 14:00 UTC (permalink / raw)
To: Hannes Reinecke; +Cc: Mark Hounschell, linux-scsi, Christoph Hellwig
On Wed, 2015-05-13 at 10:49 +0200, Hannes Reinecke wrote:
> 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.
I assume this should have a
From: Mark Hounschell <dmarkh@cfl.rr.com>
at the top?
James
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] sd: Disable support for 256 byte/sector disks
2015-05-13 14:00 ` James Bottomley
@ 2015-05-13 14:09 ` Hannes Reinecke
2015-05-13 14:17 ` James Bottomley
0 siblings, 1 reply; 6+ messages in thread
From: Hannes Reinecke @ 2015-05-13 14:09 UTC (permalink / raw)
To: James Bottomley; +Cc: Mark Hounschell, linux-scsi, Christoph Hellwig
On 05/13/2015 04:00 PM, James Bottomley wrote:
> On Wed, 2015-05-13 at 10:49 +0200, Hannes Reinecke wrote:
>> 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.
>
> I assume this should have a
>
> From: Mark Hounschell <dmarkh@cfl.rr.com>
>
> at the top?
>
> James
>
I wasn't sure, as I've pulled the patch off bugzilla.
But do whatever you see fit.
Cheers,
Hannes
--
Dr. Hannes Reinecke zSeries & Storage
hare@suse.de +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] sd: Disable support for 256 byte/sector disks
2015-05-13 14:09 ` Hannes Reinecke
@ 2015-05-13 14:17 ` James Bottomley
2015-05-13 14:29 ` Mark Hounschell
0 siblings, 1 reply; 6+ messages in thread
From: James Bottomley @ 2015-05-13 14:17 UTC (permalink / raw)
To: Hannes Reinecke; +Cc: Mark Hounschell, linux-scsi, Christoph Hellwig
On Wed, 2015-05-13 at 16:09 +0200, Hannes Reinecke wrote:
> On 05/13/2015 04:00 PM, James Bottomley wrote:
> > On Wed, 2015-05-13 at 10:49 +0200, Hannes Reinecke wrote:
> >> 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.
> >
> > I assume this should have a
> >
> > From: Mark Hounschell <dmarkh@cfl.rr.com>
> >
> > at the top?
> >
> > James
> >
> I wasn't sure, as I've pulled the patch off bugzilla.
> But do whatever you see fit.
It needs authorship (From: field) of whoever wrote it and put it on
bugzilla in the first place. According to the entry, it was him:
https://bugzilla.kernel.org/show_bug.cgi?id=16058#c18
James
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] sd: Disable support for 256 byte/sector disks
2015-05-13 14:17 ` James Bottomley
@ 2015-05-13 14:29 ` Mark Hounschell
0 siblings, 0 replies; 6+ messages in thread
From: Mark Hounschell @ 2015-05-13 14:29 UTC (permalink / raw)
To: James Bottomley, Hannes Reinecke
Cc: Mark Hounschell, linux-scsi, Christoph Hellwig
On 05/13/2015 10:17 AM, James Bottomley wrote:
> On Wed, 2015-05-13 at 16:09 +0200, Hannes Reinecke wrote:
>> On 05/13/2015 04:00 PM, James Bottomley wrote:
>>> On Wed, 2015-05-13 at 10:49 +0200, Hannes Reinecke wrote:
>>>> 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.
>>>
>>> I assume this should have a
>>>
>>> From: Mark Hounschell <dmarkh@cfl.rr.com>
>>>
>>> at the top?
>>>
>>> James
>>>
>> I wasn't sure, as I've pulled the patch off bugzilla.
>> But do whatever you see fit.
>
> It needs authorship (From: field) of whoever wrote it and put it on
> bugzilla in the first place. According to the entry, it was him:
>
> https://bugzilla.kernel.org/show_bug.cgi?id=16058#c18
>
I am the author of that patch. What would you like me to do? My home
email address is what I used in bugzilla "dmarkh@cfl.rr.com" years back
when I originally submitted the bug. I'm sending this email from work.
I am Mark Hounschell and am the author of that patch and you can do with
it whatever you see fit?
Regards
Mark
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2015-05-13 14:29 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-13 8:49 [PATCH] sd: Disable support for 256 byte/sector disks Hannes Reinecke
2015-05-13 12:55 ` Mark Hounschell
2015-05-13 14:00 ` James Bottomley
2015-05-13 14:09 ` Hannes Reinecke
2015-05-13 14:17 ` James Bottomley
2015-05-13 14:29 ` Mark Hounschell
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox