[dm-devel] Snapshot/VFS-lock tests

Kevin Corry kevcorry at us.ibm.com
Thu Jul 31 10:54:01 UTC 2003


On Thursday 31 July 2003 09:40, Kevin Corry wrote:
> JFS:
>
> writeable snapshot:
>
> with VFS-lock:
> mount: wrong fs type, bad option, bad superblock on /dev/evms/snap1,
>        or too many mounted file systems
>
> without VFS-lock:
> mount: wrong fs type, bad option, bad superblock on /dev/evms/snap1,
>        or too many mounted file systems
>
> read-only snapshot:
>
> with VFS-lock:
> (no extra messages)
>
> without VFS-lock:
> (no extra messages)

> So, in summary:

> JFS is just weird. It doesn't like writeable snapshots, period (at least,
> not while the origin is in use). It also doesn't mind read-only snapshots,
> even without the VFS-lock patch, which goes against what we'd expect for
> journalled filesystems. I'm going to have to talk to Shaggy about this.

I just talked to Shaggy about JFS (it's mighty handy having him sit across the 
hall from me). He said JFS never complains about mounting a filesystem 
read-only, even if it's dirty. So that explains the read-only-no-VFS-lock 
case. He also explained to me that JFS does not do its journal replay in the 
kernel the way ext3 and reiser do. Thus, in the writeable-no-VFS-lock case, 
you need to run mkfs.jfs on the snapshot. This will replay the journal, and 
allow the snapshot to mount cleanly.

He was a bit confused about the writeable-with-VFS-lock case. He went to 
consult the JFS code, and found a bug in their write_super_lockfs function. 
He sent me a patch (which I've attached below), and now this test case works 
as expected, with the snapshot mounting cleanly with no complaints.

Shaggy said he will forward this patch on to Marcello, and it will hopefully 
be included in 2.4.22. If not, we could add this patch to the VFS-lock patch 
for the time being.

Here is the updated chart for JFS:


JFS:

writeable snapshot:

with VFS-lock:
(no extra messages)

without VFS-lock:
mount: wrong fs type, bad option, bad superblock on /dev/evms/snap1,
       or too many mounted file systems
(run fsck.jfs)
fsck.jfs version 1.0.21, 12-Aug-2002
The current device is:  /dev/evms/snap1
Block size in bytes:  4096
File system size in blocks:  262205
Phase 0 - Replay Journal Log
File system is clean.
(mounts cleanly - no extra messages)

read-only snapshot:

with VFS-lock:
(no extra messages)

without VFS-lock:
(no extra messages)

-- 
Kevin Corry
kevcorry at us.ibm.com
http://evms.sourceforge.net/


diff -ur linux-2.4.21/fs/jfs/super.c linux/fs/jfs/super.c
--- linux-2.4.21/fs/jfs/super.c	2003-06-13 09:51:37.000000000 -0500
+++ linux/fs/jfs/super.c	2003-07-31 10:06:23.000000000 -0500
@@ -337,6 +337,7 @@
 	if (!(sb->s_flags & MS_RDONLY)) {
 		txQuiesce(sb);
 		lmLogShutdown(log);
+		updateSuper(sb, FM_CLEAN);
 	}
 }

@@ -347,6 +348,7 @@
 	int rc = 0;

 	if (!(sb->s_flags & MS_RDONLY)) {
+		updateSuper(sb, FM_MOUNT);
 		if ((rc = lmLogInit(log)))
 			jfs_err("jfs_unlock failed with return code %d", rc);
 		else





More information about the dm-devel mailing list