public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Patrick McHardy <kaber@trash.net>
To: Eric Dumazet <eric.dumazet@gmail.com>,
	Pablo Neira Ayuso <pablo@netfilter.org>,
	David Miller <davem@davemloft.net>
Cc: netdev <netdev@vger.kernel.org>, netfilter-devel@vger.kernel.org
Subject: Re: [PATCH] netfilter: nf_sockopt_find() should return ERESTARTSYS
Date: Thu, 24 Jul 2014 18:19:35 +0100	[thread overview]
Message-ID: <3ff5bf70-5db3-4dc4-9f02-abb07843ab81@email.android.com> (raw)
In-Reply-To: <1406155995.3363.19.camel@edumazet-glaptop2.roam.corp.google.com>

On 23. Juli 2014 23:53:15 GMT+01:00, Eric Dumazet <eric.dumazet@gmail.com> wrote:
>From: Eric Dumazet <edumazet@google.com>
>
>getsockopt() or setsockopt() sometimes returns -EINTR instead of
>-ENOPROTOOPT, causing headaches to application developers.
>
>This is because unsupported commands might go through nf_sockopt_find()
>and this function returns -EINTR instead of -ERESTARTSYS if
>a signal is pending.
>

I'd propose to simply use the non interruptable mutex functions. We
have many instances where this is really completely unnecessary.

I can take care of this (once my notebook has been repaired).

>Signed-off-by: Eric Dumazet <edumazet@google.com>
>---
> net/netfilter/nf_sockopt.c |    2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>diff --git a/net/netfilter/nf_sockopt.c b/net/netfilter/nf_sockopt.c
>index f042ae521557..37181447715b 100644
>--- a/net/netfilter/nf_sockopt.c
>+++ b/net/netfilter/nf_sockopt.c
>@@ -66,7 +66,7 @@ static struct nf_sockopt_ops *nf_sockopt_find(struct
>sock *sk, u_int8_t pf,
> 	struct nf_sockopt_ops *ops;
> 
> 	if (mutex_lock_interruptible(&nf_sockopt_mutex) != 0)
>-		return ERR_PTR(-EINTR);
>+		return ERR_PTR(-ERESTARTSYS);
> 
> 	list_for_each_entry(ops, &nf_sockopts, list) {
> 		if (ops->pf == pf) {
>
>



  reply	other threads:[~2014-07-24 17:19 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-23 22:53 [PATCH] netfilter: nf_sockopt_find() should return ERESTARTSYS Eric Dumazet
2014-07-24 17:19 ` Patrick McHardy [this message]
2014-07-24 20:35   ` Eric Dumazet
2014-07-24 20:41   ` [PATCH v2] netfilter: nf_sockopt_find() / nf_register_sockopt() should not return EINTR Eric Dumazet
2014-07-31 10:55     ` Pablo Neira Ayuso
2014-07-31 11:05       ` Patrick McHardy

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=3ff5bf70-5db3-4dc4-9f02-abb07843ab81@email.android.com \
    --to=kaber@trash.net \
    --cc=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --cc=netdev@vger.kernel.org \
    --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