public inbox for stgt@vger.kernel.org
 help / color / mirror / Atom feed
* "tgtadm --mode system --show" doesn't show  global 'outgoing' users if there are no global incoming users
@ 2014-08-15  6:39 Phillip Brown
  2014-08-22 10:23 ` FUJITA Tomonori
  0 siblings, 1 reply; 3+ messages in thread
From: Phillip Brown @ 2014-08-15  6:39 UTC (permalink / raw)
  To: stgt

Note - I am not subscribed to the mailing list

Noticed that if there are 'outgoing' users but no 'incoming' users bound 
at system level, then tgtadm --mode system --show does not show the 
outgoing users. c.f. at target level where targets show outgoing users 
even if there are no incoming users

[root@filer3 init.d]# tgtadm --op show --mode sys
System:
        State: ready
LLDs:
        iser: error
        iscsi: ready
Backing stores:
        rdwr (bsoflags sync:direct)
        aio
        ssc
        null
        bsg
        sg
Device types:
        passthrough
        tape
        changer
        controller
        osd
        cd/dvd
        disk
iSNS:
        iSNS=Off
        iSNSServerIP=
        iSNSServerPort=3205
        iSNSAccessControl=Off
[root@filer3 init.d]# tgtadm --lld iscsi --mode account --op new --user 
test --password testpass
[root@filer3 init.d]# tgtadm --mode account --op bind --user test --outgoing
[root@filer3 init.d]# tgtadm --mode sys --op show
System:
        State: ready
LLDs:
        iser: error
        iscsi: ready
Backing stores:
        rdwr (bsoflags sync:direct)
        aio
        ssc
        null
        bsg
        sg
Device types:
        passthrough
        tape
        changer
        controller
        osd
        cd/dvd
        disk
iSNS: *   Account info for outg**oing user should be here*
        iSNS=Off
        iSNSServerIP=
        iSNSServerPort=3205
        iSNSAccessControl=Off
[root@filer3 init.d]# tgtadm --mode account --op bind --user test
[root@filer3 init.d]# tgtadm --mode sys --op show
System:
        State: ready
LLDs:
        iser: error
        iscsi: ready
Backing stores:
        rdwr (bsoflags sync:direct)
        aio
        ssc
        null
        bsg
        sg
Device types:
        passthrough
        tape
        changer
        controller
        osd
        cd/dvd
        disk
Account information:
        test
        test (outgoing)
iSNS:
        iSNS=Off
        iSNSServerIP=
        iSNSServerPort=3205
        iSNSAccessControl=Off
[root@filer3 init.d]#


Problem seems to be with this 'if' statement in targets.c:system_show 
function

--------->> if (global_target.account.nr_inaccount) {
                                int i, aid;
                                concat_printf(b, _TAB1 "%s\n", "Account 
information:\n");
                                for (i = 0; i < 
global_target.account.nr_inaccount; i++) {
                                                aid = 
global_target.account.in_aids[i];
                                                concat_printf(b, _TAB1 
"%s\n",
            __account_lookup_id(aid)->user);
                                }
                                if (global_target.account.out_aid) {
                                                aid = 
global_target.account.out_aid;
                                                concat_printf(b, _TAB1 
"%s (outgoing)\n",
            __account_lookup_id(aid)->user);
                                }
                }

Does there really need to be that test?

regards

Phillip Brown

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: "tgtadm --mode system --show" doesn't show global 'outgoing' users if there are no global incoming users
  2014-08-15  6:39 "tgtadm --mode system --show" doesn't show global 'outgoing' users if there are no global incoming users Phillip Brown
@ 2014-08-22 10:23 ` FUJITA Tomonori
  2014-08-22 10:33   ` FUJITA Tomonori
  0 siblings, 1 reply; 3+ messages in thread
From: FUJITA Tomonori @ 2014-08-22 10:23 UTC (permalink / raw)
  To: phillip.brown.j; +Cc: stgt

Hi,

On Fri, 15 Aug 2014 16:39:18 +1000
Phillip Brown <phillip.brown.j@gmail.com> wrote:

> Problem seems to be with this 'if' statement in targets.c:system_show
> function
> 
> --------->> if (global_target.account.nr_inaccount) {
>                                int i, aid;
>                                concat_printf(b, _TAB1 "%s\n", "Account information:\n");
>                                for (i = 0; i < global_target.account.nr_inaccount; i++) {
>                                                aid = global_target.account.in_aids[i];
>                                                concat_printf(b, _TAB1 "%s\n",
>            __account_lookup_id(aid)->user);
>                                }
>                                if (global_target.account.out_aid) {
>                                                aid = global_target.account.out_aid;
>                                                concat_printf(b, _TAB1 "%s (outgoing)\n",
>            __account_lookup_id(aid)->user);
>                                }
>                }
> 
> Does there really need to be that test?

Probably, I wrote the above code but can't recall why. Looks like we
can remove the above 'if'. Can you send a patch?

Thanks!

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: "tgtadm --mode system --show" doesn't show global 'outgoing' users if there are no global incoming users
  2014-08-22 10:23 ` FUJITA Tomonori
@ 2014-08-22 10:33   ` FUJITA Tomonori
  0 siblings, 0 replies; 3+ messages in thread
From: FUJITA Tomonori @ 2014-08-22 10:33 UTC (permalink / raw)
  To: phillip.brown.j; +Cc: stgt

On Fri, 22 Aug 2014 19:23:17 +0900 (JST)
FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> wrote:

> Hi,
> 
> On Fri, 15 Aug 2014 16:39:18 +1000
> Phillip Brown <phillip.brown.j@gmail.com> wrote:
> 
>> Problem seems to be with this 'if' statement in targets.c:system_show
>> function
>> 
>> --------->> if (global_target.account.nr_inaccount) {
>>                                int i, aid;
>>                                concat_printf(b, _TAB1 "%s\n", "Account information:\n");
>>                                for (i = 0; i < global_target.account.nr_inaccount; i++) {
>>                                                aid = global_target.account.in_aids[i];
>>                                                concat_printf(b, _TAB1 "%s\n",
>>            __account_lookup_id(aid)->user);
>>                                }
>>                                if (global_target.account.out_aid) {
>>                                                aid = global_target.account.out_aid;
>>                                                concat_printf(b, _TAB1 "%s (outgoing)\n",
>>            __account_lookup_id(aid)->user);
>>                                }
>>                }
>> 
>> Does there really need to be that test?
> 
> Probably, I wrote the above code but can't recall why. Looks like we
> can remove the above 'if'. Can you send a patch?

Now I recalled.

With one-way CHAP authentication, a target authenticate initiators
(in account). The opposite is not supported. So if an out account
always needs in account(s).

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-08-22 10:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-15  6:39 "tgtadm --mode system --show" doesn't show global 'outgoing' users if there are no global incoming users Phillip Brown
2014-08-22 10:23 ` FUJITA Tomonori
2014-08-22 10:33   ` FUJITA Tomonori

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox