[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20140110154742.GE4132@redhat.com>
Date: Fri, 10 Jan 2014 16:47:42 +0100
From: Veaceslav Falico <vfalico@...hat.com>
To: Alexander Duyck <alexander.h.duyck@...el.com>
Cc: netdev@...r.kernel.org, Jiri Pirko <jiri@...nulli.us>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Nicolas Dichtel <nicolas.dichtel@...nd.com>
Subject: Re: [PATCH net-next] net: make dev_set_mtu() honor notification
return code
On Fri, Jan 10, 2014 at 07:36:45AM -0800, Alexander Duyck wrote:
>On 01/10/2014 04:48 AM, Veaceslav Falico wrote:
...snip...
>> - err = 0;
>> - if (ops->ndo_change_mtu)
>> - err = ops->ndo_change_mtu(dev, new_mtu);
>> - else
>> - dev->mtu = new_mtu;
>> + orig_mtu = dev->mtu;
>> + err = __dev_set_mtu(dev, new_mtu);
>>
>> - if (!err)
>> - call_netdevice_notifiers(NETDEV_CHANGEMTU, dev);
>> + if (!err) {
>> + err = call_netdevice_notifiers(NETDEV_CHANGEMTU, dev);
>> + err = notifier_to_errno(err);
>> + if (err)
>> + __dev_set_mtu(dev, orig_mtu);
>> + }
>> return err;
>> }
>> EXPORT_SYMBOL(dev_set_mtu);
>
>So what about the netdevices that succeeded in changing the MTU based on
>the notifiers? It seems like you still have an inconsistent state
>after the failure unless you issue a second call with a notification
>that you reverted to the old MTU.
Good point, thank you. I'll add a second call_netdevice_notifiers() after
setting the original MTU and resend.
Thank you!
>
>Thanks,
>
>Alex
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists