diff options
author | Amir Goldstein <amir73il@gmail.com> | 2019-01-10 20:04:41 +0300 |
---|---|---|
committer | Jan Kara <jack@suse.cz> | 2019-02-07 18:38:36 +0300 |
commit | 0321e03cb4572fb3b56582bcb4927c1fe985b191 (patch) | |
tree | d1b872b9b848f96c9bde1dd74b5f80a851c4b893 /include | |
parent | 0a20df7ed3349dfa3260ddee2efa919df44d0ad5 (diff) | |
download | linux-0321e03cb4572fb3b56582bcb4927c1fe985b191.tar.xz |
fanotify: check FS_ISDIR flag instead of d_is_dir()
All fsnotify hooks set the FS_ISDIR flag for events that happen
on directory victim inodes except for fsnotify_perm().
Add the missing FS_ISDIR flag in fsnotify_perm() hook and let
fanotify_group_event_mask() check the FS_ISDIR flag instead of
checking if path argument is a directory.
This is needed for fanotify support for event types that do not
carry path information.
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/fsnotify.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/fsnotify.h b/include/linux/fsnotify.h index 9becae610022..09587e2860b5 100644 --- a/include/linux/fsnotify.h +++ b/include/linux/fsnotify.h @@ -79,6 +79,9 @@ static inline int fsnotify_perm(struct file *file, int mask) fsnotify_mask = FS_ACCESS_PERM; } + if (S_ISDIR(inode->i_mode)) + fsnotify_mask |= FS_ISDIR; + return fsnotify_path(inode, path, fsnotify_mask); } |