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

From: David Howells
Date: Thu Aug 17 2006 - 09:44:07 EST


Andrew Morton <akpm@xxxxxxxx> 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@xxxxxxxxxx>

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

Signed-Off-By: David Howells <dhowells@xxxxxxxxxx>
---

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);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/