gvisor/pkg/sentry/fsimpl/memfs
Jamie Liu 128948d6ae Implement basic umounting for vfs2.
This is required to test filesystems with a non-trivial implementation of
FilesystemImpl.Release(). Propagation isn't handled yet, and umount isn't yet
plumbed out to VirtualFilesystem.UmountAt(), but otherwise the implementation
of umount is believed to be correct.

- Move entering mountTable.seq writer critical sections to callers of
  mountTable.{insert,remove}Seqed. This is required since umount(2) must ensure
  that no new references are taken on the candidate mount after checking that
  it isn't busy, which is only possible by entering a vfs.mountTable.seq writer
  critical section before the check and remaining in it until after
  VFS.umountRecursiveLocked() is complete. (Linux does the same thing:
  fs/namespace.c:do_umount() => lock_mount_hash(),
  fs/pnode.c:propagate_mount_busy(), umount_tree(), unlock_mount_hash().)

- It's not possible for dentry deletion to umount while only holding
  VFS.mountMu for reading, but it's also very unappealing to hold VFS.mountMu
  exclusively around e.g. gofer unlink RPCs. Introduce dentry.mu to avoid these
  problems. This means that VFS.mountMu is never acquired for reading, so
  change it to a sync.Mutex.

PiperOrigin-RevId: 282444343
2019-11-25 15:21:49 -08:00
..
BUILD Implement basic umounting for vfs2. 2019-11-25 15:21:49 -08:00
benchmark_test.go Implement basic umounting for vfs2. 2019-11-25 15:21:49 -08:00
directory.go Change linux.FileMode from uint to uint16, and update VFS to use FileMode. 2019-10-04 14:20:32 -07:00
filesystem.go Add support for pipes in VFS2. 2019-10-19 11:49:38 -07:00
memfs.go Add support for pipes in VFS2. 2019-10-19 11:49:38 -07:00
named_pipe.go Add support for pipes in VFS2. 2019-10-19 11:49:38 -07:00
pipe_test.go Add support for pipes in VFS2. 2019-10-19 11:49:38 -07:00
regular_file.go Change linux.FileMode from uint to uint16, and update VFS to use FileMode. 2019-10-04 14:20:32 -07:00
symlink.go memfs fixes. 2019-08-08 11:46:38 -07:00