* [PATCH] scsi_debug: virtual_gb ignores sector_size
@ 2010-04-25 10:30 Douglas Gilbert
2010-04-26 14:44 ` Martin K. Petersen
2010-05-02 15:44 ` James Bottomley
0 siblings, 2 replies; 4+ messages in thread
From: Douglas Gilbert @ 2010-04-25 10:30 UTC (permalink / raw)
To: James Bottomley, SCSI development list; +Cc: Martin K. Petersen
[-- Attachment #1: Type: text/plain, Size: 396 bytes --]
In the scsi_debug driver, the virtual_gb option
ignores the sector_size, implicitly assuming
that is 512 bytes.
So if 'virtual_gb=1 sector_size=4096' the result is
an 8 GB (virtual) disk.
ChangeLog:
- correct get_sdebug_capacity() calculation of
sectors when virtual_gb option is used. Needs
to take into account sector_size.
Signed-off-by: Douglas Gilbert <dgilbert@interlog.com>
[-- Attachment #2: sdebug_vgig_ss1.patch --]
[-- Type: text/x-patch, Size: 751 bytes --]
--- linux/drivers/scsi/scsi_debug.c 2010-03-24 20:13:03.000000000 +0100
+++ linux/drivers/scsi/scsi_debug.c2633mqnu2ss 2010-04-25 12:03:50.000000000 +0200
@@ -58,7 +58,7 @@
#include "scsi_logging.h"
#define SCSI_DEBUG_VERSION "1.82"
-static const char * scsi_debug_version_date = "20100324";
+static const char * scsi_debug_version_date = "20100425";
/* Additional Sense Code (ASC) */
#define NO_ADDITIONAL_SENSE 0x0
@@ -961,7 +961,8 @@ static int resp_start_stop(struct scsi_c
static sector_t get_sdebug_capacity(void)
{
if (scsi_debug_virtual_gb > 0)
- return 2048 * 1024 * (sector_t)scsi_debug_virtual_gb;
+ return (sector_t)scsi_debug_virtual_gb *
+ (1073741824 / scsi_debug_sector_size);
else
return sdebug_store_sectors;
}
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] scsi_debug: virtual_gb ignores sector_size
2010-04-25 10:30 [PATCH] scsi_debug: virtual_gb ignores sector_size Douglas Gilbert
@ 2010-04-26 14:44 ` Martin K. Petersen
2010-04-26 14:46 ` James Bottomley
2010-05-02 15:44 ` James Bottomley
1 sibling, 1 reply; 4+ messages in thread
From: Martin K. Petersen @ 2010-04-26 14:44 UTC (permalink / raw)
To: dgilbert; +Cc: James Bottomley, SCSI development list, Martin K. Petersen
>>>>> "Doug" == Douglas Gilbert <dgilbert@interlog.com> writes:
Doug> In the scsi_debug driver, the virtual_gb option ignores the
Doug> sector_size, implicitly assuming that is 512 bytes. So if
Doug> 'virtual_gb=1 sector_size=4096' the result is an 8 GB (virtual)
Doug> disk.
Acked-by: Martin K. Petersen <martin.petersen@oracle.com>
James: We've got quite a few unmerged scsi_debug changes out there right
now. Are you keeping track??
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] scsi_debug: virtual_gb ignores sector_size
2010-04-26 14:44 ` Martin K. Petersen
@ 2010-04-26 14:46 ` James Bottomley
0 siblings, 0 replies; 4+ messages in thread
From: James Bottomley @ 2010-04-26 14:46 UTC (permalink / raw)
To: Martin K. Petersen; +Cc: dgilbert, SCSI development list
On Mon, 2010-04-26 at 10:44 -0400, Martin K. Petersen wrote:
> >>>>> "Doug" == Douglas Gilbert <dgilbert@interlog.com> writes:
>
> Doug> In the scsi_debug driver, the virtual_gb option ignores the
> Doug> sector_size, implicitly assuming that is 512 bytes. So if
> Doug> 'virtual_gb=1 sector_size=4096' the result is an 8 GB (virtual)
> Doug> disk.
>
> Acked-by: Martin K. Petersen <martin.petersen@oracle.com>
>
>
> James: We've got quite a few unmerged scsi_debug changes out there right
> now. Are you keeping track??
Yes, but unless I missed something, Doug is still the maintainer, so I'm
waiting for his testing and ack on some of the ones you submitted.
James
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] scsi_debug: virtual_gb ignores sector_size
2010-04-25 10:30 [PATCH] scsi_debug: virtual_gb ignores sector_size Douglas Gilbert
2010-04-26 14:44 ` Martin K. Petersen
@ 2010-05-02 15:44 ` James Bottomley
1 sibling, 0 replies; 4+ messages in thread
From: James Bottomley @ 2010-05-02 15:44 UTC (permalink / raw)
To: dgilbert; +Cc: SCSI development list, Martin K. Petersen
On Sun, 2010-04-25 at 12:30 +0200, Douglas Gilbert wrote:
> --- linux/drivers/scsi/scsi_debug.c 2010-03-24 20:13:03.000000000
> +0100
> +++ linux/drivers/scsi/scsi_debug.c2633mqnu2ss 2010-04-25
> 12:03:50.000000000 +0200
> @@ -58,7 +58,7 @@
> #include "scsi_logging.h"
>
> #define SCSI_DEBUG_VERSION "1.82"
> -static const char * scsi_debug_version_date = "20100324";
> +static const char * scsi_debug_version_date = "20100425";
I got a rejection here ... presumably because there's a missing patch
somewhere along the way.
I've got to say, I don't think bumping the date with every patch is a
good idea ... apart from the patch ordering problems, it will give
rejections every time I try to send a patch to stable (which I'm doing
with this).
James
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-05-02 15:44 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-25 10:30 [PATCH] scsi_debug: virtual_gb ignores sector_size Douglas Gilbert
2010-04-26 14:44 ` Martin K. Petersen
2010-04-26 14:46 ` James Bottomley
2010-05-02 15:44 ` James Bottomley
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox