projects
/
systemd
/
.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c63db54
)
network/sr-iov: ignore -EINVAL in reading dev_port sysfs attribute
author
Yu Watanabe
<watanabe.yu+github@gmail.com>
Thu, 7 Sep 2023 15:54:08 +0000
(
00:54
+0900)
committer
Yu Watanabe
<watanabe.yu+github@gmail.com>
Fri, 8 Sep 2023 11:08:18 +0000
(20:08 +0900)
Fixes #27369.
src/network/networkd-sriov.c
patch
|
blob
|
history
diff --git
a/src/network/networkd-sriov.c
b/src/network/networkd-sriov.c
index 1f205b7468e7384de33ef883b867f31bb9c66132..562a53b7ddb5df2b471a0617ab031cb94bc28124 100644
(file)
--- a/
src/network/networkd-sriov.c
+++ b/
src/network/networkd-sriov.c
@@
-209,7
+209,11
@@
static int link_set_sr_iov_phys_port(Link *link) {
if (!link->dev)
return -ENODEV;
+ /* This may return -EINVAL or -ENODEV, instead of -ENOENT, if the device has been removed or is being
+ * removed. Let's map -EINVAL to -ENODEV, as the caller will ignore -ENODEV. */
r = sd_device_get_sysattr_value(link->dev, "dev_port", &dev_port);
+ if (r == -EINVAL)
+ return -ENODEV;
if (r < 0)
return r;
@@
-242,6
+246,8
@@
static int link_set_sr_iov_virt_ports(Link *link) {
return -ENODEV;
r = sd_device_get_sysattr_value(link->dev, "dev_port", &dev_port);
+ if (r == -EINVAL)
+ return -ENODEV;
if (r < 0)
return r;