proc: warn on non-existing proc entries
authorAlexey Dobriyan <adobriyan@gmail.com>
Fri, 5 Mar 2010 21:44:00 +0000 (13:44 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 6 Mar 2010 19:26:45 +0000 (11:26 -0800)
* 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>
fs/proc/generic.c

index ce2d95477701b43770c6669b0d18239561b6dcf7..08f4d71dacd7fba3e9a704cb77c9131b6d0c5d69 100644 (file)
@@ -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);
        /*