linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Jörn Engel" <joern@logfs.org>
To: Douglas Gilbert <dgilbert@interlog.com>
Cc: "James E.J. Bottomley" <JBottomley@parallels.com>,
	linux-scsi@vger.kernel.org
Subject: Re: [PATCH 07/10] sg: protect sdp->exclude
Date: Tue, 24 Apr 2012 16:16:59 -0400	[thread overview]
Message-ID: <20120424201658.GD20610@logfs.org> (raw)
In-Reply-To: <4F95D426.7000406@interlog.com>

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@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2012-04-24 22:16 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-12 21:32 [PATCH 01/10] sg: remove unnecessary indentation Jörn Engel
2012-04-12 21:32 ` [PATCH 02/10] sg: remove while (1) non-loop Jörn Engel
2012-05-16 21:57   ` Douglas Gilbert
2012-04-12 21:33 ` [PATCH 03/10] " Jörn Engel
2012-05-16 21:57   ` Douglas Gilbert
2012-04-12 21:33 ` [PATCH 04/10] sg: use wait_event_interruptible() Jörn Engel
2012-05-16 21:57   ` Douglas Gilbert
2012-04-12 21:33 ` [PATCH 05/10] sg: remove closed flag Jörn Engel
2012-05-16 21:57   ` Douglas Gilbert
2012-04-12 21:33 ` [PATCH 06/10] sg: prevent unwoken sleep Jörn Engel
2012-05-16 21:57   ` Douglas Gilbert
2012-04-12 21:34 ` [PATCH 07/10] sg: protect sdp->exclude Jörn Engel
2012-04-23 22:13   ` Douglas Gilbert
2012-04-24 20:13     ` [PATCH v2 " Jörn Engel
2012-05-16 21:57       ` Douglas Gilbert
2012-04-24 20:16     ` Jörn Engel [this message]
2012-04-12 21:34 ` [PATCH 08/10] sg: completely protect sfds Jörn Engel
2012-04-25 15:17   ` [PATCH v2 " Jörn Engel
2012-05-16 21:57     ` Douglas Gilbert
2012-04-12 21:35 ` [PATCH 09/10] sg: remove sg_mutex Jörn Engel
2012-05-16 21:57   ` Douglas Gilbert
2012-04-12 21:35 ` [PATCH 10/10] sg: constify sg_proc_leaf_arr Jörn Engel
2012-05-16 21:58   ` Douglas Gilbert
2012-05-07 19:44 ` [PATCH 01/10] sg: remove unnecessary indentation Jörn Engel
2012-05-11 14:43   ` Jörn Engel
2012-05-16 21:57 ` Douglas Gilbert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120424201658.GD20610@logfs.org \
    --to=joern@logfs.org \
    --cc=JBottomley@parallels.com \
    --cc=dgilbert@interlog.com \
    --cc=linux-scsi@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).