Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to add watch for /: No such device #31

Open
step- opened this issue Apr 17, 2024 · 0 comments
Open

Failed to add watch for /: No such device #31

step- opened this issue Apr 17, 2024 · 0 comments

Comments

@step-
Copy link

step- commented Apr 17, 2024

Running fatrace -C touch as root on kernel 6.1.46:

fatrace: Failed to add watch for /: No such device

Running strace fatrace I can better see the error:

fanotify_mark(3, FAN_MARK_ADD|FAN_MARK_FILESYSTEM, FAN_ACCESS|FAN_MODIFY|FAN_CLOSE_WRITE|FAN_CLOSE_NOWRITE|FAN_OPEN|FAN_MOVED_FROM|FAN_MOVED_TO|FAN_CREATE|FAN_DELETE|FAN_ONDIR|FAN_EVENT_ON_CHILD, AT_FDCWD, "/") = -1 ENODEV (No such device)

On this system, "/" is a mount point which using aufs file system. cat /proc/mounts:

proc /proc proc rw,relatime 0 0
sysfs /sys sysfs rw,relatime 0 0
devtmpfs /dev devtmpfs rw,relatime,size=8030144k,nr_inodes=2007536,mode=755 0 0
/dev/loop0 /aufs/kernel-modules squashfs ro,relatime,errors=continue 0 0
/dev/loop1 /aufs/pup_ro squashfs ro,relatime,errors=continue 0 0
/dev/sdc2 /aufs/devsave ext4 rw,relatime 0 0
aufs / aufs rw,relatime,si=736d9d04cb017ae1 0 0
devpts /dev/pts devpts rw,relatime,gid=3,mode=620,ptmxmode=000 0 0
tmpfs /dev/shm tmpfs rw,relatime,mode=777 0 0
tmpfs /tmp tmpfs rw,relatime 0 0
cgroup /sys/fs/cgroup cgroup rw,relatime,cpuset,cpu,cpuacct,blkio,memory,devices,freezer,net_cls,perf_event,net_prio,pids,misc 0 0
fusectl /sys/fs/fuse/connections fusectl rw,relatime 0 0
/dev/sdb3 /mnt/l ext4 rw,relatime 0 0

So I tried changing

if (res < 0 && errno == EINVAL && mark_mode & FAN_MARK_FILESYSTEM)

from

    if (res < 0 && errno == EINVAL && mark_mode & FAN_MARK_FILESYSTEM)

to

    if (res < 0 && ((errno == EINVAL && mark_mode & FAN_MARK_FILESYSTEM) || errno == ENODEV))

Then ran fatrace -C touch again but things got worse. In addition to "/", now aufs and ext4 mounted file systems (their mount points) and device loops are reported:

fatrace: Failed to add watch for /: Invalid argument
fatrace: Failed to add watch for /aufs/kernel-modules: Invalid argument
fatrace: Failed to add watch for /aufs/pup_ro: Invalid argument
fatrace: Failed to add watch for /aufs/devsave: Invalid argument
fatrace: Failed to add watch for /mnt/l: Invalid argument
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant