Linux X.25 subsystem development
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Andrew Hendry <andrew.hendry@gmail.com>,
	linux-kernel@vger.kernel.org, linux-x25@vger.kernel.org,
	netdev@vger.kernel.org
Subject: Re: [PATCH v2] x25: remove the BKL
Date: Thu, 27 Jan 2011 14:43:39 +0100	[thread overview]
Message-ID: <201101271443.40007.arnd@arndb.de> (raw)
In-Reply-To: <1296134447.2614.5.camel@edumazet-laptop>

On Thursday 27 January 2011, Eric Dumazet wrote:
> Le jeudi 27 janvier 2011 à 13:38 +0100, Arnd Bergmann a écrit :
> > diff --git a/net/x25/x25_out.c b/net/x25/x25_out.c
> > index d00649f..f1a6ff1 100644
> > --- a/net/x25/x25_out.c
> > +++ b/net/x25/x25_out.c
> > @@ -68,8 +68,11 @@ int x25_output(struct sock *sk, struct sk_buff *skb)
> >               frontlen = skb_headroom(skb);
> >  
> >               while (skb->len > 0) {
> > -                     if ((skbn = sock_alloc_send_skb(sk, frontlen + max_len,
> > -                                                     noblock, &err)) == NULL){
> > +                     release_sock(sk);
> > +                     skbn = sock_alloc_send_skb(sk, frontlen + max_len,
> > +                                                1, &err);
> > +                     lock_sock(sk);
> > +                     if (!skbn) {
> >                               if (err == -EWOULDBLOCK && noblock){
> >                                       kfree_skb(skb);
> >                                       return sent;
> 
> This part looks strange :
> 
> noblock variable became "const 1 : NOBLOCK"
> 
> Why releasing socket if you dont block in sock_alloc_send_skb() ?

Leftover from an earlier version of the patch, thanks for catching this!

Originally, I wrote this as

	long timeo = sock_sndtimeo(sk, noblock)
	do {
		skbn = sock_alloc_send_skb(sk, frontlen + max_len, 1, &err);
		if (skbn)
			break;

		release_sock(sk);
		timeo = sock_wait_for_wmem(sk, timeo);
		lock_sock(sk);
	} while (timeo);

Then I forgot to flip it back after I noticed that other protocols also just
call release_sock/lock_sock around sock_alloc_send_skb.

I think I'd better go over the whole series and see if there are more things
that got slightly broken...

	Arnd

  reply	other threads:[~2011-01-27 13:43 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-25 22:17 [RFC 00/20] Proposal for remaining BKL users Arnd Bergmann
2011-01-25 22:17 ` [PATCH 12/20] x25: remove the BKL Arnd Bergmann
2011-01-27 10:07   ` Andrew Hendry
2011-01-27 12:17     ` Arnd Bergmann
2011-01-27 12:38       ` [PATCH v2] " Arnd Bergmann
2011-01-27 13:20         ` Eric Dumazet
2011-01-27 13:43           ` Arnd Bergmann [this message]
2011-01-26  2:22 ` [RFC 00/20] Proposal for remaining BKL users Greg KH
2011-01-26 11:31   ` Arnd Bergmann
2011-01-26 11:58     ` Mauro Carvalho Chehab
2011-01-26 13:45       ` Arnd Bergmann
2011-01-26 16:24         ` Palash Bandyopadhyay

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=201101271443.40007.arnd@arndb.de \
    --to=arnd@arndb.de \
    --cc=andrew.hendry@gmail.com \
    --cc=eric.dumazet@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-x25@vger.kernel.org \
    --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