[stgt] Why is tid 0 illegal?

FUJITA Tomonori fujita.tomonori at lab.ntt.co.jp
Tue Jul 16 07:32:50 CEST 2013


On Mon, 15 Jul 2013 17:43:58 -0700
Dan Mick <dan.mick at inktank.com> wrote:

> On 07/15/2013 04:40 PM, Dan Mick wrote:
>> tgtadm rejects tid 0.  Why?  There is a -1 sentinel value, and 0 is
>> certainly a legal SCSI target number.

Can't recall why.

>> I get that lun0 is reserved, but is rejecting target 0 a bug?
> 
> 
> The following let me go all the way to a working target 0:

Some existing code (e.g. under scripts/) might depend on the above
behavior. So I don't like to change unless we have to change.


> --- a/usr/tgtadm.c
> +++ b/usr/tgtadm.c
> @@ -654,7 +654,7 @@ int main(int argc, char **argv)
>         }
> 
>         if (mode == MODE_TARGET) {
> -               if ((tid <= 0 && (op != OP_SHOW))) {
> +               if ((tid < 0 && (op != OP_SHOW))) {
>                         eprintf("'tid' option is necessary\n");
>                         exit(EINVAL);
>                 }
> @@ -792,7 +792,7 @@ int main(int argc, char **argv)
>         }
> 
>         if (mode == MODE_DEVICE) {
> -               if (tid <= 0) {
> +               if (tid < 0) {
>                         eprintf("'tid' option is necessary\n");
>                         exit(EINVAL);
>                 }
> --
> 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
--
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