Disable file handle sharing for FUSE filesystems

This is similar to the NFS case.

Fixes #10740

PiperOrigin-RevId: 660997934
This commit is contained in:
Ayush Ranjan
2024-08-08 15:17:16 -07:00
committed by gVisor bot
parent fa6e6811ed
commit 8191404896
+4 -4
View File
@@ -686,12 +686,12 @@ func adjustMountOptions(conf *config.Config, path string, opts []string) ([]stri
switch statfs.Type {
case unix.OVERLAYFS_SUPER_MAGIC:
rv = append(rv, "overlayfs_stale_read")
case unix.NFS_SUPER_MAGIC:
case unix.NFS_SUPER_MAGIC, unix.FUSE_SUPER_MAGIC:
// The gofer client implements remote file handle sharing for performance.
// However, remote filesystems like NFS rely on close(2) syscall for
// flushing file data to the server. Such handle sharing prevents the
// However, remote filesystems like NFS and FUSE rely on close(2) syscall
// for flushing file data to the server. Such handle sharing prevents the
// application's close(2) syscall from being propagated to the host. Hence
// disable file handle sharing, so NFS files are flushed correctly.
// disable file handle sharing, so remote files are flushed correctly.
rv = append(rv, "disable_file_handle_sharing")
}
return rv, nil