From: Nick Piggin Date: Wed, 6 Feb 2008 09:37:28 +0000 (-0800) Subject: inotify: fix race X-Git-Tag: v2.6.25-rc1~702 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d599e36a9ea85432587f4550acc113cd7549d12a;p=pandora-kernel.git inotify: fix race There is a race between setting an inode's children's "parent watched" flag when placing the first watch on a parent, and instantiating new children of that parent: a child could miss having its flags set by set_dentry_child_flags, but then inotify_d_instantiate might still see !inotify_inode_watched. The solution is to set_dentry_child_flags after adding the watch. Locking is taken care of, because both set_dentry_child_flags and inotify_d_instantiate hold dcache_lock and child->d_locks. Signed-off-by: Nick Piggin Cc: Robert Love Cc: John McCutchan Cc: Jan Kara Cc: Yan Zheng Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- Reading git-diff-tree failed