diff options
Diffstat (limited to 'include/linux/dcache.h')
| -rw-r--r-- | include/linux/dcache.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/dcache.h b/include/linux/dcache.h index 339a770eedbd..bb9e6b8b15c2 100644 --- a/include/linux/dcache.h +++ b/include/linux/dcache.h @@ -262,6 +262,8 @@ extern char * d_path(struct dentry *, struct vfsmount *, char *, int); static __inline__ struct dentry * dget(struct dentry *dentry) { if (dentry) { + if (!atomic_read(&dentry->d_count)) + BUG(); atomic_inc(&dentry->d_count); dentry->d_vfs_flags |= DCACHE_REFERENCED; } |
