Open ajdlinux opened 1 year ago
Thanks for the bug @ajdlinux can you please attach the output of the following to this bug as I don't have access to this hardware and would like to see how sysfs represents the device files.
#!/bin/bash
ls -l /sys/class/net/wpan1/device/
ls -l /sys/devices/platform/mac802154_hwsim/ieee802154/phy1/
ls -l /sys/class/net/wpan1/device/device/
[ -f /sys/class/net/wpan1/device/device/device ] && cat /sys/class/net/wpan1/device/device/device
I agree this is a bug in how cloud-init handles those nested device links. I just don't have a full enough picture to understand how we should fix this without additional logs related to the /sys/class/net files representing this device and configuration.
Output is as follows:
total 0
lrwxrwxrwx 1 root root 0 Jul 19 13:40 device -> ../../../mac802154_hwsim
-r--r--r-- 1 root root 65536 Jul 19 13:40 index
-r--r--r-- 1 root root 65536 Jul 19 13:40 name
drwxr-xr-x 3 root root 0 Jul 19 13:40 net
drwxr-xr-x 2 root root 0 Jul 19 13:40 power
lrwxrwxrwx 1 root root 0 Jul 19 13:40 subsystem -> ../../../../../class/ieee802154
-rw-r--r-- 1 root root 65536 Jul 19 13:40 uevent
total 0
lrwxrwxrwx 1 root root 0 Jul 19 13:40 device -> ../../../mac802154_hwsim
-r--r--r-- 1 root root 65536 Jul 19 13:40 index
-r--r--r-- 1 root root 65536 Jul 19 13:40 name
drwxr-xr-x 3 root root 0 Jul 19 13:40 net
drwxr-xr-x 2 root root 0 Jul 19 13:40 power
lrwxrwxrwx 1 root root 0 Jul 19 13:40 subsystem -> ../../../../../class/ieee802154
-rw-r--r-- 1 root root 65536 Jul 19 13:40 uevent
total 0
lrwxrwxrwx 1 root root 0 Jul 19 13:40 driver -> ../../../bus/platform/drivers/mac802154_hwsim
-rw-r--r-- 1 root root 65536 Jul 19 13:41 driver_override
drwxr-xr-x 4 root root 0 Jul 19 13:40 ieee802154
-r--r--r-- 1 root root 65536 Jul 19 13:41 modalias
drwxr-xr-x 2 root root 0 Jul 19 13:41 power
lrwxrwxrwx 1 root root 0 Jul 19 13:40 subsystem -> ../../../bus/platform
-rw-r--r-- 1 root root 65536 Jul 19 13:40 uevent
Bug report
The presence of a simulated WPAN network interface created using mac802154_hwsim causes an exception:
/sys/class/net/wpan1/device
is a symlink to the directory/sys/devices/platform/mac802154_hwsim/ieee802154/phy1
, and/sys/class/net/wpan1/device/device
is a symlink to the directory/sys/devices/platform/mac802154_hwsim
.Perhaps
read_sys_net()
can handle EISDIR?Steps to reproduce the problem
Environment details
cloud-init logs
cloud-init.tar.gz