Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
inotify: invalid mask should return a error number but not set it
When we run the crackerjack testsuite, the inotify_add_watch test is stalled. This is caused by the invalid mask 0 - the task is waiting for the event but it never comes. inotify_add_watch() should return -EINVAL as it did before commit 676a067 ("inotify: remove broken mask checks causing unmount to be EINVAL"). That commit removes the invalid mask check, but that check is needed. Check the mask's ALL_INOTIFY_BITS before the inotify_arg_to_mask() call. If none are set, just return -EINVAL. Because IN_UNMOUNT is in ALL_INOTIFY_BITS, this change will not trigger the problem that above commit fixed. [[email protected]: fix build] Signed-off-by: Zhao Hongjiang <[email protected]> Acked-by: Jim Somerville <[email protected]> Cc: Paul Gortmaker <[email protected]> Cc: Jerome Marchand <[email protected]> Cc: Eric Paris <[email protected]> Cc: <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
- Loading branch information