Problems using JFS on the root partition

Support knowledgebase (grimmer_jfs)
Applies to

SuSE Linux: Version 7.3

Symptom:

You have formatted your root partition using IBM's journaled file system "JFS". When mounting the root partition on bootup, the system seems to be in an endless loop, printing the following messages:

VFS: Mounted root (jfs filesystem) readonly.
change_root: old root has d_count=2
Trying to unmount old root ... okay
Freeing unused kernel memory: 124k freed
Adding Swap: 128480k swap-space (priority 42)
jfs_dirty inode called on read-only volume
Is remount racy?
jfs_dirty inode called on read-only volume
Is remount racy?
jfs_dirty inode called on read-only volume
Is remount racy?
jfs_dirty inode called on read-only volume
Is remount racy?
jfs_dirty inode called on read-only volume
Is remount racy?
jfs_dirty inode called on read-only volume
Is remount racy?

[...]

Note: This is not an endless loop - the system will continue to boot normally after some time. However, it may take a long while.

Cause:

IBM JFS is (at least on Linux) a quite "young" file system and is still under development.

Version 1.0.5 used in kernel 2.4.10 of SuSE Linux 7.3 has a bug that only surfaces in the special case, that the root partition is being mounted read-only on bootup first. The problem is that writes to read-only devices cause the kernel to mark the device inode as dirty. JFS assumed that an attempt to mark an inode dirty on a read-only volume was a bug. When the volume is dirty, fsck.jfs writes a lot to the volume, causing the warning to be printed far too many times. Using a frame buffer console will slow down the output of these warnings even further.

Solution:

This bug has been fixed in later versions of JFS. Therefore it is possible, to replace the JFS kernel module with a newer, self-compiled version right after the initial installation.

Alternatively, this special problem can be resolved by applying the following patch to the SuSE 2.4.10 kernel sources (Package kernel-source.rpm and recompiling the kernel modules:

--- linux-2.4.10.SuSE/fs/jfs/inode.c	Fri Sep 28 10:30:19 2001
+++ linux-2.4.10-suse+/fs/jfs/inode.c	Sun Oct 28 15:27:52 2001
@@ -91,6 +91,9 @@
 	make_bad_inode(inode);
 }
 
+/* This define is from fs/open.c */
+#define special_file(m) (S_ISCHR(m)||S_ISBLK(m)||S_ISFIFO(m)||S_ISSOCK(m))
+
 /*
  * Workhorse of both fsync & write_inode
  */
@@ -98,13 +101,20 @@
 {
 	int rc = 0;
 	int tid;
+	static int noisy = 5;
 
 	jFYI(1, ("In jfs_commit_inode, inode = 0x%p\n", inode));
 
 	if (isReadOnly(inode)) {
-		jERROR(1,("jfs_commit_inode(0x%p) called on read-only volume\n",
-			inode));
-		jERROR(1,("Is remount racy?\n"));
+		/* kernel allows writes to devices on read-only
+		 * partitions and may think inode is dirty
+		 */
+		if(!special_file(inode->i_mode) && noisy) {
+			jERROR(1,("jfs_commit_inode(0x%p) called on "
+				  "read-only volume\n", inode));
+			jERROR(1,("Is remount racy?\n"));
+			noisy--;
+		}
 		return 0;
 	}
 
@@ -176,9 +186,18 @@
 #if LINUX_VERSION_CODE > KERNEL_VERSION(2,4,1)
 void jfs_dirty_inode(struct inode *inode)
 {
+	static int noisy = 5;
+
 	if (isReadOnly(inode)) {
-		jERROR(1,("jfs_dirty inode called on read-only volume\n"));
-		jERROR(1,("Is remount racy?\n"));
+		if(!special_file(inode->i_mode) && noisy) {
+			/* kernel allows writes to devices on read-only
+			 * partitions and may try to mark inode dirty
+			 */
+			jERROR(1,("jfs_dirty_inode called on "
+				  "read-only volume\n"));
+			jERROR(1,("Is remount racy?\n"));
+			noisy--;
+		}
 		return;
 	}
 	/*

As a workaround, we currently recommend not to use JFS on the root partition (also see "Warning message during the installation (JFS)" (http://sdb.suse.de/en/sdb/html/jfs_root_73.html)) and use an alternative journaled file system (e.g. ReiserFS) instead.


Keywords: JFS, ROOT PARTITION, BOOT, ENDLESS LOOP, JFS_DIRTY INODE, READ-ONLY VOLUME, IS REMOUNT RACY

Categories: Booting

SDB-grimmer_jfs, Copyright SuSE Linux AG, Nürnberg, Germany - Version: 31. Okt 2001
SuSE Linux AG - Last generated: 06. Nov 2001 by grimmer (sdb_gen 1.40.0)