Commit da35a55b authored by Paul Menage's avatar Paul Menage Committed by james toy

Add a WARN_ON_ONCE() to check for passing an unreferenced dentry to dput().

This is analogous to the similar check in dget(), and will make
reference-counting bugs in filesystems more immediately obvious. (I
just spent a while debugging an oops that turned out to be due to
broken fs reference counting.)
Signed-off-by: default avatarPaul Menage <menage@google.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent 1cdf07e1
......@@ -217,6 +217,7 @@ void dput(struct dentry *dentry)
if (!dentry)
return;
WARN_ON_ONCE(!atomic_read(&dentry->d_count));
repeat:
if (atomic_read(&dentry->d_count) == 1)
might_sleep();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment