summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/fsimpl/gofer
AgeCommit message (Collapse)Author
2020-08-18Merge release-20200810.0-52-g6405525b0 (automated)gVisor bot
2020-08-18Avoid holding locks when opening files in VFS2.Jamie Liu
Fixes #3243, #3521 PiperOrigin-RevId: 327308890
2020-08-17Merge release-20200810.0-41-ge3e1b3689 (automated)gVisor bot
2020-08-17[vfs] Do O_DIRECTORY check after resolving symlinks.Ayush Ranjan
Fixes python runtime test test_glob. Updates #3515 We were checking is the to-be-opened dentry is a dir or not before resolving symlinks. We should check that after resolving symlinks. This was preventing us from opening a symlink which pointed to a directory with O_DIRECTORY. Also added this check in tmpfs and removed a duplicate check. PiperOrigin-RevId: 327085895
2020-08-14Merge release-20200810.0-28-gd6520e1d0 (automated)gVisor bot
2020-08-13[vfs2][gofer] Fix file creation flags sent to gofer.Ayush Ranjan
Fixes php runtime test ext/standard/tests/file/readfile_basic.phpt Fixes #3516 fsgofers only want the access mode in the OpenFlags passed to Create(). If more flags are supplied (like O_APPEND in this case), read/write from that fd will fail with EBADF. See runsc/fsgofer/fsgofer.go:WriteAt() VFS2 was providing more than just access modes. So filtering the flags using p9.OpenFlagsModeMask == linux.O_ACCMODE fixes the issue. Gofer in VFS1 also only extracts the access mode flags while making the create RPC. See pkg/sentry/fs/gofer/path.go:Create() Even in VFS2, when we open a handle, we extract out only the access mode flags + O_TRUNC. See third_party/gvisor/pkg/sentry/fsimpl/gofer/handle.go:openHandle() Added a test for this. PiperOrigin-RevId: 326574829
2020-08-13Merge release-20200810.0-20-g42b610d56 (automated)gVisor bot
2020-08-12[vfs2][gofer] Return appropriate errors when opening and creating files.Ayush Ranjan
Fixes php test ext/standard/tests/file/touch_variation5.phpt on vfs2. Updates #3516 Also spotted a bug with O_EXCL, where we did not return EEXIST when we tried to open the root of the filesystem with O_EXCL | O_CREAT. Added some more tests for open() corner cases. PiperOrigin-RevId: 326346863
2020-08-08Merge release-20200804.0-49-g343661770 (automated)gVisor bot
2020-08-07Don't hold gofer.filesystem.renameMu during dentry destruction.Jamie Liu
PiperOrigin-RevId: 325546629
2020-08-07Merge release-20200804.0-45-g0b7cd1e75 (automated)gVisor bot
2020-08-07Mark dropped pages unevictable in fsimpl/gofer.dentry.destroyLocked.Jamie Liu
PiperOrigin-RevId: 325531657
2020-08-07Merge release-20200804.0-39-g93cb66825 (automated)gVisor bot
2020-08-07Support separate read/write handles in fsimpl/gofer.dentry.Jamie Liu
PiperOrigin-RevId: 325490674
2020-08-07Merge release-20200804.0-36-g4fa1c304a (automated)gVisor bot
2020-08-07Try to update atime and mtime on VFS2 gofer files on dentry eviction.Jamie Liu
PiperOrigin-RevId: 325388385
2020-08-07Merge release-20200804.0-35-gf20e63e31 (automated)gVisor bot
2020-08-06Add LinkAt support to goferFabricio Voznika
Updates #1198 PiperOrigin-RevId: 325350818
2020-08-05Merge release-20200622.1-334-g102735bfb (automated)gVisor bot
2020-08-04Inline gofer.regularFileFD.pwriteLockedFabricio Voznika
Go compiler barely inlines anything, so inline by hand pwriteLocked since it's called from a single place. PiperOrigin-RevId: 324937734
2020-08-03Merge release-20200622.1-313-gb2ae7ea1b (automated)gVisor bot
2020-08-03Plumbing context.Context to DecRef() and Release().Nayana Bidari
context is passed to DecRef() and Release() which is needed for SO_LINGER implementation. PiperOrigin-RevId: 324672584
2020-07-27Merge release-20200622.1-232-gf347a578b (automated)gVisor bot
2020-07-27Move platform.File in memmapAndrei Vagin
The subsequent systrap changes will need to import memmap from the platform package. PiperOrigin-RevId: 323409486
2020-07-24Merge release-20200622.1-210-gd9a3f5d0c (automated)gVisor bot
2020-07-23Add permission checks to vfs2 truncate.Dean Deng
- Check write permission on truncate(2). Unlike ftruncate(2), truncate(2) fails if the user does not have write permissions on the file. - For gofers under InteropModeShared, check file type before making a truncate request. We should fail early and avoid making an rpc when possible. Furthermore, depending on the remote host's failure may give us unexpected behavior--if the host converts the truncate request to an ftruncate syscall on an open fd, we will get EINVAL instead of EISDIR. Updates #2923. PiperOrigin-RevId: 322913569
2020-07-23Merge release-20200622.1-192-g4fbd0728a (automated)gVisor bot
2020-07-23[vfs2][gofer] Fix update attributes race condition.Ayush Ranjan
We were getting the file attributes before locking the metadataMu which was causing stale updates to the file attributes. Fixes OpenTest_AppendConcurrentWrite. Updates #2923 PiperOrigin-RevId: 322804438
2020-07-22Merge release-20200622.1-185-g39525d64c (automated)gVisor bot
2020-07-22Add O_APPEND support in vfs2 gofer.Ayush Ranjan
Helps in fixing open syscall tests: AppendConcurrentWrite and AppendOnly. We also now update the file size for seekable special files (regular files) which we were not doing earlier. Updates #2923 PiperOrigin-RevId: 322670843
2020-07-15Merge release-20200622.1-156-g1b9965e06 (automated)gVisor bot
2020-07-14Update special file option name in comment.Dean Deng
PiperOrigin-RevId: 321269281
2020-07-13Merge release-20200622.1-102-g6994f4d59 (automated)gVisor bot
2020-07-13[vfs2] Make gofer metadata atomics consistentAyush Ranjan
For accessing metadata fields: - If metadataMu is locked, we can access without atomics - If metadataMu is unlocked, we should use atomics For mutating metadata fields: - Always lock metadataMu and use atomics. There were some instances of inconsistencies which have been fixed. PiperOrigin-RevId: 321022895
2020-07-07Merge release-20200622.1-71-ge227450dc (automated)gVisor bot
2020-07-06Call fdnotifier.UpdateFD() from fsimpl/gofer.specialFileFD.Jamie Liu
The fdnotifier package provides an API to a thread that continually epolls arbitrary host FDs. The set of events polled for each host FD is (intended to be) all events for which a waiter.Entry has expressed interest, as returned by waiter.Queue.Events() for the waiter.Queue registered to the given host FD. When the set of events changes (due to a change in the set of registered waiter.Entries), the mutator must call fdnotifier.UpdateFD() to recalculate the new event set and propagate it to the epoll FD. PiperOrigin-RevId: 319924719
2020-07-07Merge release-20200622.1-70-g937912a48 (automated)gVisor bot
2020-07-06Ensure sync is called for readonly fileFabricio Voznika
Calling sync on a readonly file flushes metadata that may have been modified, like last access time. Updates #1198 PiperOrigin-RevId: 319888290
2020-07-06Merge release-20200622.1-67-gbd43368f4 (automated)gVisor bot
2020-07-06Add inode number to synthetic dentriesFabricio Voznika
Reserve the MSB from ino for synthetic dentries to prevent conflict with regular dentries. Log warning in case MSB is set for regular dentries. Updates #1487 PiperOrigin-RevId: 319869858
2020-07-02Merge release-20200622.1-59-g6c099d830 (automated)gVisor bot
2020-07-01Update preadv2/pwritev2 flag handling in vfs2.Dean Deng
We do not support RWF_SYNC/RWF_DSYNC and probably shouldn't silently accept them, since the user may incorrectly believe that we are synchronizing I/O. Remove the pwritev2 test verifying that we support these flags. gvisor.dev/issue/2601 is the tracking bug for deciding which RWF_.* flags we need and supporting them. Updates #2923, #2601. PiperOrigin-RevId: 319351286
2020-07-02Merge release-20200622.1-58-g514955c1a (automated)gVisor bot
2020-07-01[vfs2][gofer] Fix mmap syscall test.Ayush Ranjan
We were not invalidating mappings when the file size changed in shared mode. Enabled the syscall test for vfs2. Updates #2923 PiperOrigin-RevId: 319346569
2020-07-02Merge release-20200622.1-57-g52b44719d (automated)gVisor bot
2020-07-01[vfs2][gofer] Update file size to 0 on O_TRUNCAyush Ranjan
Some Open:TruncateXxx syscall tests were failing because the file size was not being updated when the file was opened with O_TRUNC. Fixes Truncate tests in test/syscalls:open_test_runsc_ptrace_vfs2. Updates #2923 PiperOrigin-RevId: 319340127
2020-07-02Merge release-20200622.1-55-g65d998555 (automated)gVisor bot
2020-07-01Port vfs1 implementation of sync_file_range to vfs2.Dean Deng
Currently, we always perform a full-file sync which could be extremely expensive for some applications. Although vfs1 did not fully support sync_file_range, there were some optimizations that allowed us skip some unnecessary write-outs. Updates #2923, #1897. PiperOrigin-RevId: 319324213
2020-07-01Merge release-20200622.1-52-g6a90c88b9 (automated)gVisor bot
2020-07-01Port fallocate to VFS2.Zach Koopmans
PiperOrigin-RevId: 319283715