ziglang / zig

General-purpose programming language and toolchain for maintaining robust, optimal, and reusable software.

Home Page:https://ziglang.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

avoid file system watches on read-only mounts

andrewrk opened this issue · comments

Follow-up from #20580.

name_to_handle_at gives us a mount ID here:

try posix.name_to_handle_at(path.root_dir.handle.fd, adjusted_path, stack_ptr, &mount_id, std.os.linux.AT.HANDLE_FID);

If this mount is read-only then the watch system should not waste any resources placing a mark on any directories within because they will never change!

Related:

commented

No insight on the particulars of read-only mounts, but I assume they could be un-mounted and then re-mounted with different data while the program is running?
That could either be considered an error and explicitly unsupported, or supported by a "mount watch" mechanism spanning all files within (maybe by only watching the first file on it, if that tells us enough to detect re-mounting?).

ehh if that's possible and it doesn't even change the mount id then this should be closed