diff options
author | Alexey Dobriyan <adobriyan@gmail.com> | 2010-03-05 13:44:00 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-03-06 11:26:45 -0800 |
commit | 12bac0d9f4dbf3445a0319beee848d15fa32775e (patch) | |
tree | 4b712e05e785c010a31d12bb4a1f662173b9fcee /fs | |
parent | e17a5765f20d1219c3f05eb17aab11671978e0ec (diff) | |
download | linux-12bac0d9f4dbf3445a0319beee848d15fa32775e.tar.bz2 |
proc: warn on non-existing proc entries
* warn if creation goes on to non-existent directory
* warn if removal goes on from non-existing directory
* warn if non-existing proc entry is removed
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/proc/generic.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/fs/proc/generic.c b/fs/proc/generic.c index ce2d95477701..08f4d71dacd7 100644 --- a/fs/proc/generic.c +++ b/fs/proc/generic.c @@ -312,8 +312,10 @@ static int __xlate_proc_name(const char *name, struct proc_dir_entry **ret, if (proc_match(len, cp, de)) break; } - if (!de) + if (!de) { + WARN(1, "name '%s'\n", name); return -ENOENT; + } cp += len + 1; } *residual = cp; @@ -818,8 +820,10 @@ void remove_proc_entry(const char *name, struct proc_dir_entry *parent) } } spin_unlock(&proc_subdir_lock); - if (!de) + if (!de) { + WARN(1, "name '%s'\n", name); return; + } spin_lock(&de->pde_unload_lock); /* |