diff options
-rw-r--r-- | include/linux/fsnotify.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/include/linux/fsnotify.h b/include/linux/fsnotify.h index ecb43b33d18..5c185fa2708 100644 --- a/include/linux/fsnotify.h +++ b/include/linux/fsnotify.h @@ -235,10 +235,11 @@ static inline void fsnotify_open(struct file *file) if (S_ISDIR(inode->i_mode)) mask |= FS_ISDIR; - if (!(file->f_mode & FMODE_NONOTIFY)) { - fsnotify_parent(path, NULL, mask); - fsnotify(inode, mask, path, FSNOTIFY_EVENT_PATH, NULL, 0); - } + /* FMODE_NONOTIFY must never be set from user */ + file->f_mode &= ~FMODE_NONOTIFY; + + fsnotify_parent(path, NULL, mask); + fsnotify(inode, mask, path, FSNOTIFY_EVENT_PATH, NULL, 0); } /* |