瀏覽代碼

[PATCH] inotify: fix one-shot support

Fix one-shot support in inotify.  We currently drop the IN_ONESHOT flag
during watch addition.  Fix is to not do that.

Signed-off-by: Robert Love <rml@novell.com>
Cc: John McCutchan <ttb@tentacle.dhs.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Robert Love 19 年之前
父節點
當前提交
b5173119ff
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      fs/inotify.c

+ 1 - 1
fs/inotify.c

@@ -967,7 +967,7 @@ asmlinkage long sys_inotify_add_watch(int fd, const char __user *path, u32 mask)
 		mask_add = 1;
 
 	/* don't let user-space set invalid bits: we don't want flags set */
-	mask &= IN_ALL_EVENTS;
+	mask &= IN_ALL_EVENTS | IN_ONESHOT;
 	if (unlikely(!mask)) {
 		ret = -EINVAL;
 		goto out;