[stgt] [PATCH] fix tid testing

FUJITA Tomonori fujita.tomonori at lab.ntt.co.jp
Fri Oct 24 02:54:08 CEST 2008


On Thu, 23 Oct 2008 10:12:28 +0200
Doron Shoham <dorons at Voltaire.COM> wrote:

> FUJITA Tomonori wrote:
> > On Wed, 22 Oct 2008 10:08:20 +0200
> > Doron Shoham <dorons at Voltaire.COM> wrote:
> > 
> >> return error if tid is not a postive integer
> >>
> >> Signed-off-by: Doron Shoham <dorons at voltaire.com>
> > 
> > In general, this patch does the right things:
> > 
> > 1. we do more strict checking
> > 2. we create a target whose id is 0.
> > 
> > But I'm a bit worry about the latter change since I guess that some
> > parts of the code assume that zero tid is an error.
> 
> Exept from the strict checking of tid<=0,
> can you remember where in the code we assume such thing?

I can't recall so I asked you. Well, I think that there were some
reason why I prohibited zero tid.


> > If you are confident that all the code can handle zero tid, it's
> > fine. But if not, please change this patch to handle zero tid as an
> > error.
> 
> Before this patch, when a user gave an invalid tid number the strtol function
> returned 0.
> This caused the new target to be created with tid=0.
> Unless we artificially decide that target's tid cannot be 0,

As I wrote above (and in the previous mail) I artificially decided
that tid cannot be 0 for some reasons but I can't recall. But I
thought that some code can't handle zero tid.


> I don't see any problems with that.

If the change doesn't break anything, it's fine by me. But seems that
you looked at only tgtadm so I don't want to do it for now.


> If we do want to use tid 0, we can consider update the tgt-admin script to
> start searching the next available tid from 0.
--
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