fs/fs-writeback.c |   20 +++++++++++++++-----
 1 files changed, 15 insertions(+), 5 deletions(-)

diff -puN fs/fs-writeback.c~mark-inode-dirty-debug fs/fs-writeback.c
--- 25/fs/fs-writeback.c~mark-inode-dirty-debug	2003-06-12 23:14:25.000000000 -0700
+++ 25-akpm/fs/fs-writeback.c	2003-06-12 23:16:15.000000000 -0700
@@ -49,8 +49,15 @@ void __mark_inode_dirty(struct inode *in
 {
 	struct super_block *sb = inode->i_sb;
 
-	if (!sb)
-		return;		/* swapper_space */
+	if (!sb) {
+		static int count;
+
+		if (count < 10) {
+			printk("%s: this cannot happen\n", __FUNCTION__);
+			count++;
+		}
+		return;
+	}
 
 	/*
 	 * Don't do this for I_DIRTY_PAGES - that doesn't actually
@@ -90,9 +97,12 @@ void __mark_inode_dirty(struct inode *in
 		 * Only add valid (hashed) inodes to the superblock's
 		 * dirty list.  Add blockdev inodes as well.
 		 */
-		if ((hlist_unhashed(&inode->i_hash) || (inode->i_state & (I_FREEING|I_CLEAR)))
-		    && !S_ISBLK(inode->i_mode))
-			goto out;
+		if (!S_ISBLK(inode->i_mode)) {
+			if (hlist_unhashed(&inode->i_hash))
+				goto out;
+			if (inode->i_state & (I_FREEING|I_CLEAR))
+				goto out;
+		}
 
 		/*
 		 * If the inode was already on s_dirty or s_io, don't

_