From: Eric Dumazet <eric.dumazet@gmail.com>
To: David Miller <davem@davemloft.net>
Cc: jarkao2@gmail.com, netdev@vger.kernel.org
Subject: Re: [PATCH net] net: Fix the rollback test in dev_change_name()
Date: Mon, 16 Nov 2009 12:08:22 +0100 [thread overview]
Message-ID: <4B0132A6.7090305@gmail.com> (raw)
In-Reply-To: <20091116.024936.14048478.davem@davemloft.net>
David Miller a écrit :
> From: Jarek Poplawski <jarkao2@gmail.com>
> Date: Mon, 16 Nov 2009 09:30:24 +0000
>
>> From: Eric Dumazet <eric.dumazet@gmail.com>
>>
>> net: Fix the rollback test in dev_change_name()
>>
>> In dev_change_name() an err variable is used for storing the original
>> call_netdevice_notifiers() errno (negative) and testing for a rollback
>> error later, but the test for non-zero is wrong, because the err might
>> have positive value as well - from dev_alloc_name(). It means the
>> rollback for a netdevice with a number > 0 will never happen. (The err
>> test is reordered btw. to make it more readable.)
>>
>> Signed-off-by: Jarek Poplawski <jarkao2@gmail.com>
>> Cc: Eric Dumazet <eric.dumazet@gmail.com>
>
> Ok.
>
> Eric please give your signoff and I'll put this where it needs
> to go.
>
I finaly understood why I got stuck on this one : I thought dev_alloc_name()
was returning 0 in case of success. The test was thus realy obscure for me.
So Jarek patch is pretty clear now I saw the light !
Thanks
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
next prev parent reply other threads:[~2009-11-16 11:08 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-30 9:20 [RFC, PATCH] net: suspicious test in dev_change_name() Eric Dumazet
2009-10-30 23:50 ` Jarek Poplawski
2009-11-02 8:05 ` David Miller
2009-11-16 9:30 ` [PATCH net] net: Fix the rollback " Jarek Poplawski
2009-11-16 10:49 ` David Miller
2009-11-16 11:08 ` Eric Dumazet [this message]
2009-11-16 11:31 ` 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=4B0132A6.7090305@gmail.com \
--to=eric.dumazet@gmail.com \
--cc=davem@davemloft.net \
--cc=jarkao2@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.