netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: andrew.hendry@gmail.com
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH] X25: Replace BKL in sockopts calls
Date: Sun, 09 May 2010 18:46:58 -0700 (PDT)	[thread overview]
Message-ID: <20100509.184658.170123822.davem@davemloft.net> (raw)
In-Reply-To: <1273409123.2727.387.camel@ibex>

From: Andrew Hendry <andrew.hendry@gmail.com>
Date: Sun, 09 May 2010 22:45:23 +1000

> @@ -465,20 +464,20 @@ static int x25_setsockopt(struct socket *sock, int level, int optname,
>  	if (get_user(opt, (int __user *)optval))
>  		goto out;
>  
> +	lock_sock(sk);
>  	x25_sk(sk)->qbitincl = !!opt;
> +	release_sock(sk);

This is completely bogus.

A store is always atomic on an SMP system, and "opt" is in a local variable
rather than being computed based upon some memory values.

There is no reason to require locking for this operation.

  reply	other threads:[~2010-05-10  1:46 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-09 12:45 [PATCH] X25: Replace BKL in sockopts calls Andrew Hendry
2010-05-10  1:46 ` David Miller [this message]
2010-05-10  4:50   ` Eric Dumazet
2010-05-10 11:44     ` David Miller

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=20100509.184658.170123822.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=andrew.hendry@gmail.com \
    --cc=netdev@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).