diff options
author | Dean Deng <deandeng@google.com> | 2020-08-03 12:30:23 -0700 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-08-03 12:36:14 -0700 |
commit | 1fbbc795ef8918006214032d96fa88b8a21e5e0a (patch) | |
tree | 1b71f6b5d6237524930f545fcaad18aa4b1dd231 /pkg/sentry/syscalls | |
parent | 07267fc4c0e91479dea8f6c3035e61e3a4d4cfa5 (diff) |
Add inotify events for fallocate and tests for fallocate/sendfile.
Updates #1479, #2923.
PiperOrigin-RevId: 324658826
Diffstat (limited to 'pkg/sentry/syscalls')
-rw-r--r-- | pkg/sentry/syscalls/linux/vfs2/setstat.go | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/pkg/sentry/syscalls/linux/vfs2/setstat.go b/pkg/sentry/syscalls/linux/vfs2/setstat.go index 37fa56c19..25cdb7a55 100644 --- a/pkg/sentry/syscalls/linux/vfs2/setstat.go +++ b/pkg/sentry/syscalls/linux/vfs2/setstat.go @@ -254,11 +254,12 @@ func Fallocate(t *kernel.Task, args arch.SyscallArguments) (uintptr, *kernel.Sys return 0, nil, syserror.EFBIG } - return 0, nil, file.Allocate(t, mode, uint64(offset), uint64(length)) + if err := file.Allocate(t, mode, uint64(offset), uint64(length)); err != nil { + return 0, nil, err + } - // File length modified, generate notification. - // TODO(gvisor.dev/issue/1479): Reenable when Inotify is ported. - // file.Dirent.InotifyEvent(linux.IN_MODIFY, 0) + file.Dentry().InotifyWithParent(linux.IN_MODIFY, 0, vfs.PathEvent) + return 0, nil, nil } // Utime implements Linux syscall utime(2). |