From 1fbbc795ef8918006214032d96fa88b8a21e5e0a Mon Sep 17 00:00:00 2001 From: Dean Deng Date: Mon, 3 Aug 2020 12:30:23 -0700 Subject: Add inotify events for fallocate and tests for fallocate/sendfile. Updates #1479, #2923. PiperOrigin-RevId: 324658826 --- pkg/sentry/syscalls/linux/vfs2/setstat.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'pkg/sentry') 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). -- cgit v1.2.3