[stgt] bs_rdwr_request
Roi Dayan
roi.dayan at gmail.com
Mon Aug 27 08:42:02 CEST 2012
On Mon, Aug 27, 2012 at 3:39 AM, FUJITA Tomonori
<fujita.tomonori at lab.ntt.co.jp> wrote:
> On Sun, 26 Aug 2012 15:58:02 +0300
> Roi Dayan <roi.dayan at gmail.com> wrote:
>
>> On Sun, Aug 26, 2012 at 3:32 PM, Roi Dayan <roi.dayan at gmail.com> wrote:
>> > On Fri, Aug 24, 2012 at 1:06 PM, <frederik.vos at linvirt.nl> wrote:
>> >>
>> >> I tested also version 1.0.28: no problem
>> >> version 1.0.29: no problem
>> >> version 1.0.30: there is the problem
>> >>
>> >>
>> >
>> >
>> >
>> > Hi,
>> >
>> > I tested as well with ESXi 5.1 and I could not login with ESXi as initiator
>> > The error from tgtd was as follows:
>> >
>> > tgtd: add_mode_page(1648) Mode Page 10 (0x01): param_count 6 != MODE
>> > PAGE size : 31
>> >
>> >
>> > I checked for commits between 1.0.29 - 1.0.30 that modify or call this
>> > function and found
>> > that commit 9a95b4431ccc01b82cb4febc735485cd06cd5ea4 added a new call
>> > to add_mode_page()
>> > and the error is the result of that new call:
>> >
>> > 518 + /* Control Extensions mode page: TCMOS:1 */
>> > 519 + add_mode_page(lu, "0x0a:1:0x1c:0x04:0x00:0x00");
>> >
>> >
>> > After removing this call ESXi logged in fine and without any problems.
>> >
>> > frederik,
>> > mind trying it as well?
>
> I guess that it's due to compare-and-write command but I might be
> wrong.
>
Hi,
The failure is because add_mode_page expect size of data according to
the size specified in the page string
i.e. for the call: add_mode_page(lu, "0x0a:1:0x1c:0x04:0x00:0x00");
the size is 0x1c (28) and the data count is 3 (0x04 0x00:0x00) so
add_mode_page fails.
The patch I sent accepts it and it means rest of the bytes in the page
data will be 0 because of how the page is allocated.
Do you still want a patch to update the callers instead?
Thanks,
Roi
>>
>>
>> Or instead of ignoring that call you could update add_mode_page() to accept it
>> even though the passed size is larger than the data supplied,
>> i tested and it works fine.
>
> I would prefer to fix the callers. I just disable the callers if
> nobody sends a fix until the end of this month.
>
>
> diff --git a/usr/mmc.c b/usr/mmc.c
> index 768fe91..cbafd2d 100644
> --- a/usr/mmc.c
> +++ b/usr/mmc.c
> @@ -2245,7 +2245,7 @@ static tgtadm_err mmc_lu_init(struct scsi_lu *lu)
> /* Control page */
> add_mode_page(lu, "0x0a:0:10:2:0:0:0:0:0:0:0:2:0");
> /* Control Extensions mode page: TCMOS:1 */
> - add_mode_page(lu, "0x0a:1:0x1c:0x04:0x00:0x00");
> + /* add_mode_page(lu, "0x0a:1:0x1c:0x04:0x00:0x00"); */
> /* Power Condition */
> add_mode_page(lu, "0x1a:0:10:8:0:0:0:0:0:0:0:0:0");
> /* Informational Exceptions Control page */
> diff --git a/usr/sbc.c b/usr/sbc.c
> index 0f99f18..3158bd5 100644
> --- a/usr/sbc.c
> +++ b/usr/sbc.c
> @@ -700,7 +700,7 @@ static tgtadm_err sbc_lu_init(struct scsi_lu *lu)
> add_mode_page(lu, "0x0a:0:10:2:0x10:0:0:0:0:0:0:2:0");
>
> /* Control Extensions mode page: TCMOS:1 */
> - add_mode_page(lu, "0x0a:1:0x1c:0x04:0x00:0x00");
> + /* add_mode_page(lu, "0x0a:1:0x1c:0x04:0x00:0x00"); */
>
> /* Informational Exceptions Control page */
> add_mode_page(lu, "0x1c:0:10:8:0:0:0:0:0:0:0:0:0");
> diff --git a/usr/smc.c b/usr/smc.c
> index 910b532..e5133d6 100644
> --- a/usr/smc.c
> +++ b/usr/smc.c
> @@ -516,7 +516,7 @@ static tgtadm_err smc_lu_init(struct scsi_lu *lu)
> /* Control page */
> add_mode_page(lu, "0x0a:0:10:2:0:0:0:0:0:0:0:2:0");
> /* Control Extensions mode page: TCMOS:1 */
> - add_mode_page(lu, "0x0a:1:0x1c:0x04:0x00:0x00");
> + /* add_mode_page(lu, "0x0a:1:0x1c:0x04:0x00:0x00"); */
> /* Power Condition */
> add_mode_page(lu, "0x1a:0:10:8:0:0:0:0:0:0:0:0:0");
> /* Informational Exceptions Control page */
> diff --git a/usr/ssc.c b/usr/ssc.c
> index 60c6926..d5df7ed 100644
> --- a/usr/ssc.c
> +++ b/usr/ssc.c
> @@ -195,7 +195,7 @@ static tgtadm_err ssc_lu_init(struct scsi_lu *lu)
> /* Control page - Mandatory - SPC-4 */
> add_mode_page(lu, "0x0a:0:10:2:0:0:0:0:0:0:0:2:0");
> /* Control Extensions mode page: TCMOS:1 */
> - add_mode_page(lu, "0x0a:1:0x1c:0x04:0x00:0x00");
> + /* add_mode_page(lu, "0x0a:1:0x1c:0x04:0x00:0x00"); */
> /* Data Compression - Mandatory - SSC3 8.3.2 */
> add_mode_page(lu, "15:0:14:0:0:0:0:0:0:0:0:0:0:0:0:0:0");
> /* Device Configuration - Mandatory - SSC3 8.3.3 */
--
To unsubscribe from this list: send the line "unsubscribe stgt" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
More information about the stgt
mailing list