[PATCH] proc: proc_get_inode should de_put when inode already initialized

Krzysztof Sachanowicz
2009-02-23T21:22:18Z

de_get is called before every proc_get_inode, but corresponding de_put is
called only when dropping last reference to an inode. This might cause
something like
remove_proc_entry: /proc/stats busy, count=14496
to be printed to the syslog.

The fix is to call de_put in case of an already initialized inode in
proc_get_inode.

Signed-off-by: Krzysztof Sachanowicz <analyzer1@gmail.com>
Tested-by: Marcin Pilipczuk <marcin.pilipczuk@gmail.com>
---
--- linux-2.6.29-rc6.orig/fs/proc/inode.c 2009-02-23 20:43:32.000000000 +0100
+++ linux-2.6.29-rc6/fs/proc/inode.c 2009-02-23 20:46:37.000000000 +0100
@@ -485,8 +485,10 @@ struct inode *proc_get_inode(struct supe
}
}
unlock_new_inode(inode);
- } else
+ } else {
module_put(de->owner);
+ de_put(de);
+ }
return inode;