v2.6.22.22-op2-rc1
[linux-2.6.22.y-op-patches.git] / release-2.6.22.y / 2.6.22.22-op1 / inotify-remove-debug-code.patch
bloba8b78cff495f7f0fa41ad38c6c293fa39bac6818
1 From 0d71bd5993b630a989d15adc2562a9ffe41cd26d Mon Sep 17 00:00:00 2001
2 From: Nick Piggin <npiggin@suse.de>
3 Date: Wed, 6 Feb 2008 01:37:29 -0800
4 Subject: [PATCH] inotify: remove debug code
6 The inotify debugging code is supposed to verify that the
7 DCACHE_INOTIFY_PARENT_WATCHED scalability optimisation does not result in
8 notifications getting lost nor extra needless locking generated.
10 Unfortunately there are also some races in the debugging code. And it isn't
11 very good at finding problems anyway. So remove it for now.
13 Signed-off-by: Nick Piggin <npiggin@suse.de>
14 Cc: Robert Love <rlove@google.com>
15 Cc: John McCutchan <ttb@tentacle.dhs.org>
16 Cc: Jan Kara <jack@ucw.cz>
17 Cc: Yan Zheng <yanzheng@21cn.com>
18 Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
19 Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
20 Signed-off-by: Oliver Pinter <oliver.pntr@gmail.com>
22 diff --git a/fs/dcache.c b/fs/dcache.c
23 index 1c323dd..44f6cf2 100644
24 --- a/fs/dcache.c
25 +++ b/fs/dcache.c
26 @@ -1408,9 +1408,6 @@ void d_delete(struct dentry * dentry)
27 if (atomic_read(&dentry->d_count) == 1) {
28 dentry_iput(dentry);
29 fsnotify_nameremove(dentry, isdir);
31 - /* remove this and other inotify debug checks after 2.6.18 */
32 - dentry->d_flags &= ~DCACHE_INOTIFY_PARENT_WATCHED;
33 return;
36 diff --git a/fs/inotify.c b/fs/inotify.c
37 index b2b109b..690e725 100644
38 --- a/fs/inotify.c
39 +++ b/fs/inotify.c
40 @@ -168,20 +168,14 @@ static void set_dentry_child_flags(struct inode *inode, int watched)
41 struct dentry *child;
43 list_for_each_entry(child, &alias->d_subdirs, d_u.d_child) {
44 - if (!child->d_inode) {
45 - WARN_ON(child->d_flags & DCACHE_INOTIFY_PARENT_WATCHED);
46 + if (!child->d_inode)
47 continue;
48 - }
50 spin_lock(&child->d_lock);
51 - if (watched) {
52 - WARN_ON(child->d_flags &
53 - DCACHE_INOTIFY_PARENT_WATCHED);
54 + if (watched)
55 child->d_flags |= DCACHE_INOTIFY_PARENT_WATCHED;
56 - } else {
57 - WARN_ON(!(child->d_flags &
58 - DCACHE_INOTIFY_PARENT_WATCHED));
59 - child->d_flags&=~DCACHE_INOTIFY_PARENT_WATCHED;
60 - }
61 + else
62 + child->d_flags &=~DCACHE_INOTIFY_PARENT_WATCHED;
63 spin_unlock(&child->d_lock);
66 @@ -253,7 +247,6 @@ void inotify_d_instantiate(struct dentry *entry, struct inode *inode)
67 if (!inode)
68 return;
70 - WARN_ON(entry->d_flags & DCACHE_INOTIFY_PARENT_WATCHED);
71 spin_lock(&entry->d_lock);
72 parent = entry->d_parent;
73 if (parent->d_inode && inotify_inode_watched(parent->d_inode))