Re: [PATCH] NFS: Replace null dentries that appear in readdir's list

David Howells
2006-08-17T13:46:15Z

Andrew Morton <akpm@osdl.org> wrote:

> VFS: Busy inodes after unmount of 0:15. Self-destruct in 5 seconds. Have a
> nice day...

And can you apply this patch as well please? It should give more information
about the problem.

David
---
VFS: Print more detail on "Busy inode after unmount" messages

From: David Howells <dhowells@redhat.com>

Print more detail on "Busy inode after unmount" messages.

Signed-Off-By: David Howells <dhowells@redhat.com>
---

fs/super.c | 34 +++++++++++++++++++++++++++++-----
1 files changed, 29 insertions(+), 5 deletions(-)

diff --git a/fs/super.c b/fs/super.c
index 3bf8e5f..ed853c4 100644
--- a/fs/super.c
+++ b/fs/super.c
@@ -219,6 +219,33 @@ static int grab_super(struct super_block
return 0;
}

+static void super_still_busy(struct super_block *sb)
+{
+ struct dentry *dentry;
+ struct inode *inode;
+ int limit;
+
+ printk("VFS: Busy inodes after unmount of %s. "
+ "Self-destruct in 5 seconds. Have a nice day...\n",
+ sb->s_id);
+
+ limit = 24;
+ list_for_each_entry(inode, &sb->s_inodes, i_sb_list) {
+ printk(KERN_ERR "- inode %p{ino=%lx,c=#%d}\n",
+ inode, inode->i_ino, atomic_read(&inode->i_count));
+ if (--limit <= 0)
+ return;
+
+ list_for_each_entry(dentry, &inode->i_dentry, d_alias) {
+ printk(KERN_ERR " - dentry %p{'%s',c=#%d}\n",
+ dentry, dentry->d_name.name,
+ atomic_read(&inode->i_count));
+ if (--limit <= 0)
+ return;
+ }
+ }
+}
+
/**
* generic_shutdown_super - common helper for ->kill_sb()
* @sb: superblock to kill
@@ -252,11 +279,8 @@ void generic_shutdown_super(struct super
sop->put_super(sb);

/* Forget any remaining inodes */
- if (invalidate_inodes(sb)) {
- printk("VFS: Busy inodes after unmount of %s. "
- "Self-destruct in 5 seconds. Have a nice day...\n",
- sb->s_id);
- }
+ if (unlikely(invalidate_inodes(sb)))
+ super_still_busy(sb);

unlock_kernel();
unlock_super(sb);