On 12/23, Tomas Henzl wrote:
>
> On 12/23/2013 04:06 PM, Jack Wang wrote:
> > On 12/23/2013 03:55 PM, Jason Seba wrote:
> >> Why is this considered dangerous?  I put some thought into it and
> >> couldn't find any obvious reason why it wouldn't work, but I also
> >> couldn't find any other drivers that work this way.  Is there a
> >> particular reason to avoid doing it this way?
> >>
> > If you use global flags, you may change interrupt state depends on context.
>
> The problem could show up when different threads try to store different 
> content to the flags.

Agreed. I have no idea if the patch is right or not, but at least
the changelog should clearly explain that only one thread can do
spin_lock_irqsave(&x->lock, x->lock_flags) at any time, otherwise
the patch (and the code) _looks_ wrong even if it is correct.

And if we can't use a local "unsigned long flags" because _unlock
can happen in another function, imho this should be mentioned in
the changelog as well.

Oleg.

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to