Skip to content

Commit a68c2f1

Browse files
swolchoktorvalds
authored andcommitted
sendfile: allows bypassing of notifier events
do_sendfile() in fs/read_write.c does not call the fsnotify functions, unlike its neighbors. This manifests as a lack of inotify ACCESS events when a file is sent using sendfile(2). Addresses https://bugzilla.kernel.org/show_bug.cgi?id=12812 [[email protected]: use fsnotify_modify(out.file), not fsnotify_access(), per Dave] Signed-off-by: Alan Cox <[email protected]> Cc: Dave Chinner <[email protected]> Cc: Jens Axboe <[email protected]> Cc: Scott Wolchok <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 891348c commit a68c2f1

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

fs/read_write.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -935,6 +935,8 @@ ssize_t do_sendfile(int out_fd, int in_fd, loff_t *ppos, size_t count,
935935
if (retval > 0) {
936936
add_rchar(current, retval);
937937
add_wchar(current, retval);
938+
fsnotify_access(in.file);
939+
fsnotify_modify(out.file);
938940
}
939941

940942
inc_syscr(current);

0 commit comments

Comments
 (0)