Skip to content

Commit

Permalink
proc: proc_get_inode should de_put when inode already initialized
Browse files Browse the repository at this point in the history
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>
Acked-by: Al Viro <viro@ZenIV.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Krzysztof Sachanowicz authored and Linus Torvalds committed Feb 24, 2009
1 parent 226485e commit cac7112
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion fs/proc/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -485,8 +485,10 @@ struct inode *proc_get_inode(struct super_block *sb, unsigned int ino,
}
}
unlock_new_inode(inode);
} else
} else {
module_put(de->owner);
de_put(de);
}
return inode;

out_ino:
Expand Down

0 comments on commit cac7112

Please sign in to comment.