Re: [PATCH 07/10] sg: protect sdp->exclude

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 23 April 2012 18:13:58 -0400, Douglas Gilbert wrote:
> 
> I have gone through the rest of this series of patches (10 of
> them posted 12 April) and they look fine. The above line worries
> me and I raised it with the author but have received no response.
> 
> A small test program suggests that the second argument to
> wait_event_interruptible [a condition] will always be true
> due to the trailing comma operator (i.e. the ", 1"). I suspect
> another set of parentheses is needed:
>   res = wait_event_interruptible(sdp->o_excl_wait,
>              ((!list_empty(&sdp->sfds) || get_exclude(sdp)) ?
> 		      0 : (set_exclude(sdp, 1), 1)));

You are right.  I made set_exclude() return the new value, which
simplifies this condition a bit.  Any simplification here is a good
thing, as I just proved that it is too complicated for my brain to
fully understand.

Thanks for spotting this, Doug!

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


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux