Skip to content

Commit

Permalink
inotify: Fix mask checks
Browse files Browse the repository at this point in the history
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: Eric Paris <eparis@redhat.com>
  • Loading branch information
Jerome Marchand authored and Eric Paris committed Jul 28, 2010
1 parent f874e1a commit 44b350f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fs/notify/inotify/inotify_user.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 44b350f

Please sign in to comment.