diff options
author | Dean Deng <deandeng@google.com> | 2020-09-17 15:36:40 -0700 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-09-17 15:38:44 -0700 |
commit | 319d1b8ba0604e7bc029f98ae0e9b09badd5abad (patch) | |
tree | 59de10aebb09e3ee68dc5444fb9abafc070cffdb /pkg/sentry/fsimpl/host | |
parent | 8070cc3386d461752dc0e601f8a11f8b54f482a6 (diff) |
Complete vfs2 implementation of fallocate.
This change includes overlay, special regular gofer files, and hostfs.
Fixes #3589.
PiperOrigin-RevId: 332330860
Diffstat (limited to 'pkg/sentry/fsimpl/host')
-rw-r--r-- | pkg/sentry/fsimpl/host/host.go | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/pkg/sentry/fsimpl/host/host.go b/pkg/sentry/fsimpl/host/host.go index 1bd0e4ee8..c4551562a 100644 --- a/pkg/sentry/fsimpl/host/host.go +++ b/pkg/sentry/fsimpl/host/host.go @@ -560,12 +560,7 @@ func (f *fileDescription) Release(context.Context) { // Allocate implements vfs.FileDescriptionImpl. func (f *fileDescription) Allocate(ctx context.Context, mode, offset, length uint64) error { - if !f.inode.seekable { - return syserror.ESPIPE - } - - // TODO(gvisor.dev/issue/3589): Implement Allocate for non-pipe hostfds. - return syserror.EOPNOTSUPP + return unix.Fallocate(f.inode.hostFD, uint32(mode), int64(offset), int64(length)) } // PRead implements FileDescriptionImpl. |