Browse files

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).


[ use fsnotify_modify(out.file), not fsnotify_access(), per Dave]
Signed-off-by: Alan Cox <>
Cc: Dave Chinner <>
Cc: Jens Axboe <>
Cc: Scott Wolchok <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
  • Loading branch information...
swolchok authored and torvalds committed Dec 20, 2012
1 parent 891348c commit a68c2f12b4b28994aaf622bbe5724b7258cc2fcf
Showing with 2 additions and 0 deletions.
  1. +2 −0 fs/read_write.c
@@ -935,6 +935,8 @@ ssize_t do_sendfile(int out_fd, int in_fd, loff_t *ppos, size_t count,
if (retval > 0) {
add_rchar(current, retval);
add_wchar(current, retval);
+ fsnotify_access(in.file);
+ fsnotify_modify(out.file);

0 comments on commit a68c2f1

Please sign in to comment.