Whamcloud - gitweb
Branch HEAD
[fs/lustre-release.git] / lustre / kernel_patches / patches / dcache_refcount_debug.patch
1 --- ./fs/dcache.c.orig  2004-01-30 14:54:45.000000000 -0700
2 +++ ./fs/dcache.c       2004-02-20 14:49:18.000000000 -0700
3 @@ -348,8 +348,20 @@
4                 dentry_stat.nr_unused--;
5  
6                 /* Unused dentry with a count? */
7 -               if (atomic_read(&dentry->d_count))
8 +               if (atomic_read(&dentry->d_count)) {
9 +                       struct inode *inode = dentry->d_inode;
10 +                       printk(KERN_CRIT "dentry %*s %p->%lu/%u(%p/%s) ct %d\n",
11 +                              dentry->d_name.len, dentry->d_name.name, dentry,
12 +                              inode ? inode->i_ino : 0,
13 +                              inode ? inode->i_generation : 0, inode,
14 +                              inode ? inode->i_sb ?
15 +                                       inode->i_sb->s_type->name : "" : "",
16 +                              atomic_read(&dentry->d_count));
17 +                       spin_unlock(&dcache_lock);
18 +                       set_task_state(current, TASK_UNINTERRUPTIBLE);
19 +                       schedule();
20                         BUG();
21 +               }
22  
23                 prune_one_dentry(dentry);
24                 if (!--count)