netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Phil Oester <kernel@linuxace.com>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: netfilter-devel@vger.kernel.org, kaber@trash.net
Subject: Re: [PATCH v3] xtables: Add locking to prevent concurrent instances
Date: Wed, 29 May 2013 14:23:33 -0400	[thread overview]
Message-ID: <20130529182333.GA5056@gmail.com> (raw)
In-Reply-To: <20130529125903.GA6390@localhost>

On Wed, May 29, 2013 at 02:59:03PM +0200, Pablo Neira Ayuso wrote:
> I think we can:
> 
> * Add a new option to explicitly request this behaviour, just as a way
>   to assert that you really want iptables to retry. Harald was rising
>   some concerns on the expected results in case of clash that sound
>   reasonable to me.

I agree that the retry behaviour could be made optional, however
I'm not sure that the locking behaviour should be optional.  It leads
to various races, some of which are subtle and can occur during if-up
and other "behind the scenes" scenarios.  In my personal experience,
I had to implement locking inside my scripts because I was hitting
races fairly regularly with dynamic rule additions/deletions (and I
suspect other admins have done the same).  Perhaps we can change the
error to say:

"Another app is currently holding the ip[6]tables lock (use -r option to enable retries)"

or something similar?  At least that is more informative than the typical
race error of "iptables: Resource temporarily unavailable".

> * Limit this to ip[6]tables. All bug reports refer to it.

Seems reasonable.  If future races are discovered in -save or -restore,
it could be easily changed.

Phil

  reply	other threads:[~2013-05-29 18:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-27 16:23 [PATCH v3] xtables: Add locking to prevent concurrent instances Phil Oester
2013-05-29 12:59 ` Pablo Neira Ayuso
2013-05-29 18:23   ` Phil Oester [this message]
2013-05-29 22:28     ` Pablo Neira Ayuso

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=20130529182333.GA5056@gmail.com \
    --to=kernel@linuxace.com \
    --cc=kaber@trash.net \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pablo@netfilter.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).