]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - include/linux/fsnotify.h
Ensure FMODE_NONOTIFY is not set by userspace
[net-next-2.6.git] / include / linux / fsnotify.h
index ecb43b33d18147a0ffdd32adfc6ccc69241c91ed..5c185fa27089f03b4e9194445ee7bfd842f125c6 100644 (file)
@@ -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);
 }
 
 /*