Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

fanotify: create FAN_ACCESS event for readdir

Before the patch, read creates FAN_ACCESS_PERM and FAN_ACCESS events,
readdir creates only FAN_ACCESS_PERM events.

This is inconsistent.

After the patch, readdir creates FAN_ACCESS_PERM and FAN_ACCESS events.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Jan Kara <jack@suse.cz>
Cc: Eric Paris <eparis@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Heinrich Schuchardt and committed by
Linus Torvalds
d4c7cf6c 0a8dd2db

+2
+2
fs/readdir.c
··· 13 13 #include <linux/stat.h> 14 14 #include <linux/file.h> 15 15 #include <linux/fs.h> 16 + #include <linux/fsnotify.h> 16 17 #include <linux/dirent.h> 17 18 #include <linux/security.h> 18 19 #include <linux/syscalls.h> ··· 41 40 ctx->pos = file->f_pos; 42 41 res = file->f_op->iterate(file, ctx); 43 42 file->f_pos = ctx->pos; 43 + fsnotify_access(file); 44 44 file_accessed(file); 45 45 } 46 46 mutex_unlock(&inode->i_mutex);