Re: tgtd 1.0.7 and large targets

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


On Tue, 2 Nov 2010 00:46:35 +0900, FUJITA Tomonori
<fujita.tomonori@xxxxxxxxxxxxx> wrote:
> On Sun, 31 Oct 2010 16:04:58 -0700
> Mike Anderson <andmike@xxxxxxxxxxxxxxxxxx> wrote:
> 
>> ronnie sahlberg <ronniesahlberg@xxxxxxxxx> wrote:
>> > Hi,
>> > 
>> > I just created a 10TB LUN with latest git for tgtd.
>> > And the initiator can successfully see that the disk is 10TB.
>> > Using ServiceActionIn/ReportCapacity16 correctly.
>> > 
>> > 
>> > My system is a 64 bit system,  is your box 32 or 64 bit?
>> > 
>> 
>> It looking at gitk between V1.0.6 and V1.0.7 I see that commit
>> 551b64ed34dbb43d6d6530a91d122c0b4d0131bd does make a change to
>> READ_CAPACITY_16.
> 
> Yeah, seems that the commit causes the problem. Old kernels request 12
> bytes for READ_CAPACITY_16. So we return invalid data.
> 
> READ_CAPACITY_16 is supposed to return 32 bytes but let's accept 12
> bytes.
> 
> Robert, can you try this patch?
> 
> diff --git a/usr/sbc.c b/usr/sbc.c
> index 3ca2aae..1f0a6ff 100644
> --- a/usr/sbc.c
> +++ b/usr/sbc.c
> @@ -201,14 +201,16 @@ static int sbc_service_action(int host_no, struct
> scsi_cmd *cmd)
>  {
>  	uint32_t *data;
>  	uint64_t size;
> -	int len = 16;
> +	int len = 32;
>  
>  	if (cmd->scb[1] != SAI_READ_CAPACITY_16)
>  		goto sense;
>  
> -	if (scsi_get_in_length(cmd) < len)
> +	if (scsi_get_in_length(cmd) < 12)
>  		goto overflow;
>  
> +	len = min_t(int, len, scsi_get_in_length(cmd));
> +
>  	data = scsi_get_in_buffer(cmd);
>  	memset(data, 0, len);


My test systems are 64-bit systems.

The patch worked great on 1.0.7 and on 1.0.10 and the initiator is seeing
the large arrays perfectly.

Thanks,
Robert
--
To unsubscribe from this list: send the line "unsubscribe stgt" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Linux SCSI]     [Linux RAID]     [Linux Clusters]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]    [Yosemite Photos]    [Free Online Dating]     [Linux Kernel]     [XFree86]     [Video Devices]

Add to Google Powered by Linux