You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
truncate on /dev/shm drops the guest's record locks #469
truncate() on a /dev/shm path drops every POSIX record lock the guest holds on that file. sys_truncate in src/syscall/fs.c reaches a /dev/shm leaf through shm_open_leaf, truncates through that descriptor and closes it. On macOS, closing any descriptor for a file releases all of the process's fcntl record locks on it, and guest F_SETLK locks are host record locks.
Measured with a static aarch64 probe: open /dev/shm/elfuse-lock-probe, take an F_SETLK write lock, call truncate(path, 100), then have a forked child check the lock with F_GETLK.
Linux's vfs_truncate opens nothing, so the lock survives. #463 removed the same open-and-close from the regular-file path of truncate after review; the /dev/shm branch was left as it was.
Goal: truncate on a /dev/shm path leaves the guest's record locks in place. The branch opens the leaf because truncate(2) has no nofollow form, so a fix would have to keep that protection without closing a descriptor on the file.
Activity