提交 44b350fc 编写于 作者: J Jerome Marchand 提交者: Eric Paris

inotify: Fix mask checks

The mask checks in inotify_update_existing_watch() and
inotify_new_watch() are useless because inotify_arg_to_mask() sets
FS_IN_IGNORED and FS_EVENT_ON_CHILD bits anyway.
Signed-off-by: NEric Paris <eparis@redhat.com>
上级 f874e1ac
......@@ -566,7 +566,7 @@ static int inotify_update_existing_watch(struct fsnotify_group *group,
/* don't allow invalid bits: we don't want flags set */
mask = inotify_arg_to_mask(arg);
if (unlikely(!mask))
if (unlikely(!(mask & IN_ALL_EVENTS)))
return -EINVAL;
fsn_mark = fsnotify_find_inode_mark(group, inode);
......@@ -624,7 +624,7 @@ static int inotify_new_watch(struct fsnotify_group *group,
/* don't allow invalid bits: we don't want flags set */
mask = inotify_arg_to_mask(arg);
if (unlikely(!mask))
if (unlikely(!(mask & IN_ALL_EVENTS)))
return -EINVAL;
tmp_i_mark = kmem_cache_alloc(inotify_inode_mark_cachep, GFP_KERNEL);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册