mirror of https://gitee.com/openkylin/linux.git
net: Avoid race between network down and sysfs
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Acked-by: "Eric W. Biederman" <ebiederm@xmission.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
07555c9880
commit
5a5990d309
|
@ -77,7 +77,9 @@ static ssize_t netdev_store(struct device *dev, struct device_attribute *attr,
|
|||
if (endp == buf)
|
||||
goto err;
|
||||
|
||||
rtnl_lock();
|
||||
if (!rtnl_trylock())
|
||||
return -ERESTARTSYS;
|
||||
|
||||
if (dev_isalive(net)) {
|
||||
if ((ret = (*set)(net, new)) == 0)
|
||||
ret = len;
|
||||
|
|
Loading…
Reference in New Issue