mikesart / inotify-info

Linux inotify info reporting app
MIT License
280 stars 29 forks source link

statx() with flags AT_STATX_DONT_SYNC returns ERRNO 22 (invalid argument) #53

Open planetrocky opened 2 months ago

planetrocky commented 2 months ago

statx() with flags:

int flags = AT_NO_AUTOMOUNT | AT_SYMLINK_NOFOLLOW | AT_STATX_DONT_SYNC;

returns ERRNO 22 (EINVAL = invalid argument) on a btrfs volume on a Synology NAS on some files*; swapping the flags to use AT_STATX_SYNC_AS_STAT, scans a 100TB array without a single stat error:

int flags = AT_NO_AUTOMOUNT | AT_SYMLINK_NOFOLLOW | AT_STATX_SYNC_AS_STAT;
planetrocky commented 2 months ago

I'm going to have to debug this more. It's not finding a single inode (and is running as UID=0).

Whereas I can manually find all the inodes that have fsnotify watches on from command-line find /volume1 -inum 222951 etc.

mikesart commented 2 months ago

Looks like this is a btrfs volume. I don't have that and have no idea what's going on there. Sorry...