Skip to contentSkip to conversation

How do I get the ext3 driver to shut up?

PATCH New Rob Landley 5 participants 11 messages Mar 14, 2006

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

I'm making a test suite for busybox mount, which does filesystem autodetection the easy way (try all the ones in /etc/filesystems and /proc/filesystems until one of them succeeds). My test code is creating and mounting vfat and ext2 filesystems.

Guess which device driver feels a bit chatty?

PASS: mount no proc [GNUFAIL]
PASS: mount /proc
PASS: mount list1
VFS: Can't find ext3 filesystem on dev loop0.
PASS: mount vfat image (autodetect type)
ext3: No journal on filesystem on loop1
PASS: mount ext2 image (autodetect type)
PASS: mount remount ext2 image noatime
PASS: mount remount ext2 image ro remembers noatime
ext3: No journal on filesystem on loop0
PASS: umount freed loop device
PASS: mount remount nonexistent directory
PASS: mount -a no fstab

Rob

Signature · 1 line
Never bet against the cheap plastic solution.
#1 lore raw
Quoted 7 lines · On Mon, 13 Mar 2006 22:18:39 -0500 Rob Landley wrote:

I'm making a test suite for busybox mount, which does filesystem autodetection the easy way (try all the ones in /etc/filesystems and /proc/filesystems until one of them succeeds). My test code is creating and mounting vfat and ext2 filesystems.

Guess which device driver feels a bit chatty?

Quoted 13 lines

PASS: mount no proc [GNUFAIL]
PASS: mount /proc
PASS: mount list1
VFS: Can't find ext3 filesystem on dev loop0.
PASS: mount vfat image (autodetect type)
ext3: No journal on filesystem on loop1
PASS: mount ext2 image (autodetect type)
PASS: mount remount ext2 image noatime
PASS: mount remount ext2 image ro remembers noatime
ext3: No journal on filesystem on loop0
PASS: umount freed loop device
PASS: mount remount nonexistent directory
PASS: mount -a no fstab

Hrm, yes, 2 of those lines do come from ext3.
Where do the rest of them come from?

---
~Randy
You can't do anything without having to do something else first. -- Belefant's Law

#5 lore raw
In reply to Rob Landley
Quoted 11 lines · Rob Landley

I'm making a test suite for busybox mount, which does filesystem autodetection
the easy way (try all the ones in /etc/filesystems and /proc/filesystems until one of them succeeds). My test code is creating and mounting vfat and ext2 filesystems.

Guess which device driver feels a bit chatty?

...

VFS: Can't find ext3 filesystem on dev loop0.

That's only printed if the sys_mount() caller set MS_VERBOSE in `flags'.

#6 lore raw

PATCH 1/1 Fix backwards meaning of MS_VERBOSE

Quoted 3 lines · Andrew Morton
Quoted 1 line

VFS: Can't find ext3 filesystem on dev loop0.

That's only printed if the sys_mount() caller set MS_VERBOSE in `flags'.

Well, that and the "ext3: No journal on filesystem on %s" message which Rob also complained about...

I was just looking at this, and it seemed counterintuitive that setting the MS_VERBOSE flag actually means "don't be verbose"; but indeed, this is the way things are, and it's consistently defined as such, starting with fs/super.c and propgated down into all of the various filesystem fs/*/super.c which copied that bit of code.

Interestingly, mount doesn't have a way of setting the MS_VERBOSE flag, but it *does* have the following:

#ifdef MS_SILENT
{ "quiet", 0, 0, MS_SILENT }, /* be quiet */
{ "loud", 0, 1, MS_SILENT }, /* print out messages. */
#endif

.... and fs.h doesn't define MS_SILENT, although it does define the MS_VERBOSE flag which has the exact opposite meaning.

So.... any objections to the following?

include/linux/fs.h +3 -1
Index: 2.6.16-rc5/include/linux/fs.h
===================================================================
@@ -102,7 +102,9 @@
 #define MS_BIND		4096
 #define MS_MOVE		8192
 #define MS_REC		16384
-#define MS_VERBOSE	32768
+#define MS_VERBOSE	32768	/* War is peace. Verbosity is silence.
+				   MS_VERBOSE is deprecated. */
+#define MS_SILENT	32768
 #define MS_POSIXACL	(1<<16)	/* VFS does not apply the umask */
 #define MS_UNBINDABLE	(1<<17)	/* change to unbindable */
 #define MS_PRIVATE	(1<<18)	/* change to private */
fs/super.c +3 -3
Index: 2.6.16-rc5/fs/super.c
===================================================================
@@ -712,7 +712,7 @@
 		s->s_flags = flags;
 		strlcpy(s->s_id, bdevname(bdev, b), sizeof(s->s_id));
 		sb_set_blocksize(s, block_size(bdev));
-		error = fill_super(s, data, flags & MS_VERBOSE ? 1 : 0);
+		error = fill_super(s, data, flags & MS_SILENT ? 1 : 0);
 		if (error) {
 			up_write(&s->s_umount);
 			deactivate_super(s);
@@ -756,7 +756,7 @@
 
 	s->s_flags = flags;
 
-	error = fill_super(s, data, flags & MS_VERBOSE ? 1 : 0);
+	error = fill_super(s, data, flags & MS_SILENT ? 1 : 0);
 	if (error) {
 		up_write(&s->s_umount);
 		deactivate_super(s);
@@ -785,7 +785,7 @@
 		return s;
 	if (!s->s_root) {
 		s->s_flags = flags;
-		error = fill_super(s, data, flags & MS_VERBOSE ? 1 : 0);
+		error = fill_super(s, data, flags & MS_SILENT ? 1 : 0);
 		if (error) {
 			up_write(&s->s_umount);
 			deactivate_super(s);
fs/afs/super.c +1 -1
Index: 2.6.16-rc5/fs/afs/super.c
===================================================================
@@ -341,7 +341,7 @@
 
 	sb->s_flags = flags;
 
-	ret = afs_fill_super(sb, &params, flags & MS_VERBOSE ? 1 : 0);
+	ret = afs_fill_super(sb, &params, flags & MS_SILENT ? 1 : 0);
 	if (ret < 0) {
 		up_write(&sb->s_umount);
 		deactivate_super(sb);
fs/cifs/cifsfs.c +1 -1
Index: 2.6.16-rc5/fs/cifs/cifsfs.c
===================================================================
@@ -479,7 +479,7 @@
 
 	sb->s_flags = flags;
 
-	rc = cifs_read_super(sb, data, dev_name, flags & MS_VERBOSE ? 1 : 0);
+	rc = cifs_read_super(sb, data, dev_name, flags & MS_SILENT ? 1 : 0);
 	if (rc) {
 		up_write(&sb->s_umount);
 		deactivate_super(sb);
fs/jffs2/super.c +2 -2
Index: 2.6.16-rc5/fs/jffs2/super.c
===================================================================
@@ -152,7 +152,7 @@
 	sb->s_op = &jffs2_super_operations;
 	sb->s_flags = flags | MS_NOATIME;
 
-	ret = jffs2_do_fill_super(sb, data, (flags&MS_VERBOSE)?1:0);
+	ret = jffs2_do_fill_super(sb, data, flags & MS_SILENT ? 1 : 0);
 
 	if (ret) {
 		/* Failure case... */
@@ -257,7 +257,7 @@
 	}
 
 	if (imajor(nd.dentry->d_inode) != MTD_BLOCK_MAJOR) {
-		if (!(flags & MS_VERBOSE)) /* Yes I mean this. Strangely */
+		if (!(flags & MS_SILENT))
 			printk(KERN_NOTICE "Attempt to mount non-MTD device \"%s\" as JFFS2\n",
 			       dev_name);
 		goto out;
fs/nfs/inode.c +2 -2
Index: 2.6.16-rc5/fs/nfs/inode.c
===================================================================
@@ -1679,7 +1679,7 @@
 
 	s->s_flags = flags;
 
-	error = nfs_fill_super(s, data, flags & MS_VERBOSE ? 1 : 0);
+	error = nfs_fill_super(s, data, flags & MS_SILENT ? 1 : 0);
 	if (error) {
 		up_write(&s->s_umount);
 		deactivate_super(s);
@@ -1996,7 +1996,7 @@
 
 	s->s_flags = flags;
 
-	error = nfs4_fill_super(s, data, flags & MS_VERBOSE ? 1 : 0);
+	error = nfs4_fill_super(s, data, flags & MS_SILENT ? 1 : 0);
 	if (error) {
 		up_write(&s->s_umount);
 		deactivate_super(s);
init/do_mounts.c +1 -1
Index: 2.6.16-rc5/init/do_mounts.c
===================================================================
@@ -19,7 +19,7 @@
 
 int __initdata rd_doload;	/* 1 = load RAM disk, 0 = don't load */
 
-int root_mountflags = MS_RDONLY | MS_VERBOSE;
+int root_mountflags = MS_RDONLY | MS_SILENT;
 char * __initdata root_device_name;
 static char __initdata saved_root_name[64];
 
#2 lore raw
In reply to Randy.Dunlap

Seems like those test suits... (PASS, FAIL...)

Quoted 37 lines · Randy.Dunlap
Quoted 7 lines · On Mon, 13 Mar 2006 22:18:39 -0500 Rob Landley wrote:

I'm making a test suite for busybox mount, which does filesystem autodetection the easy way (try all the ones in /etc/filesystems and /proc/filesystems until one of them succeeds). My test code is creating and mounting vfat and ext2 filesystems.

Guess which device driver feels a bit chatty?

Quoted 13 lines

PASS: mount no proc [GNUFAIL]
PASS: mount /proc
PASS: mount list1
VFS: Can't find ext3 filesystem on dev loop0.
PASS: mount vfat image (autodetect type)
ext3: No journal on filesystem on loop1
PASS: mount ext2 image (autodetect type)
PASS: mount remount ext2 image noatime
PASS: mount remount ext2 image ro remembers noatime
ext3: No journal on filesystem on loop0
PASS: umount freed loop device
PASS: mount remount nonexistent directory
PASS: mount -a no fstab

Hrm, yes, 2 of those lines do come from ext3.
Where do the rest of them come from?

---
~Randy
You can't do anything without having to do something else first. -- Belefant's Law
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

#7 lore raw
In reply to Andrew Morton
Quoted 7 lines · Andrew Morton
Quoted 5 lines

Guess which device driver feels a bit chatty?

...

VFS: Can't find ext3 filesystem on dev loop0.

That's only printed if the sys_mount() caller set MS_VERBOSE in `flags'.

I should have been a bit more explict in my previous message. Actually, if you trace down the logic, it's only printed if sys_mount() __DIDN'T__ set MS_VERBOSE in 'flags'. The code in fs/super.c sets the "silent" flag if (flags & MS_VERBOSE) is non-zero. The meaning is reversed, which is counterintuitive. Hence, my patch.

- Ted

#3 lore raw
In reply to Randy.Dunlap
Quoted 22 lines · Randy.Dunlap
Quoted 7 lines · On Mon, 13 Mar 2006 22:18:39 -0500 Rob Landley wrote:

I'm making a test suite for busybox mount, which does filesystem autodetection the easy way (try all the ones in /etc/filesystems and /proc/filesystems until one of them succeeds). My test code is creating and mounting vfat and ext2 filesystems.

Guess which device driver feels a bit chatty?

Quoted 13 lines

PASS: mount no proc [GNUFAIL]
PASS: mount /proc
PASS: mount list1
VFS: Can't find ext3 filesystem on dev loop0.
PASS: mount vfat image (autodetect type)
ext3: No journal on filesystem on loop1
PASS: mount ext2 image (autodetect type)
PASS: mount remount ext2 image noatime
PASS: mount remount ext2 image ro remembers noatime
ext3: No journal on filesystem on loop0
PASS: umount freed loop device
PASS: mount remount nonexistent directory
PASS: mount -a no fstab

Quoted 1 line

Hrm, yes, 2 of those lines do come from ext3.

Three, actually.

Quoted 1 line

Where do the rest of them come from?

My half-finished regression test suite for busybox mount. I just rewrote the busybox "mount" command to fix a half-dozen bugs (the hardest of which was making it properly reentrant so "mount -a" behaves properly). And I basically had to derive a spec for mount from first principles (which I've halfway written up, should probably finish and post somewhere), and now I'm writing The Regression Test Of Doom.

It runs under User Mode Linux, so it has a nice little clean root environment to work in and there's no worry about cleanup for when I typo something in the script and it crashes halfway through, because when the UML environment exits it takes its current mounts with it. Eventually I'll probably get it to run under a normal root environment...

Let's see... Tarball attached, and I've been running it with:
~/linux-2.6.16-rc5/linux rootfstype=hostfs rw \
init=/home/landley/busybox/busybox/testsuite/mount.testroot \
TESTDIR=/home/landley/busybox/busybox/testsuite COMMAND=./mount quiet

Rob

Signature · 1 line
Never bet against the cheap plastic solution.
#10 lore raw
In reply to Andrew Morton
Quoted 6 lines · Andrew Morton
Quoted 5 lines · Rob Landley

I'm making a test suite for busybox mount, which does filesystem autodetection the easy way (try all the ones in /etc/filesystems and /proc/filesystems until one of them succeeds). My test code is creating and mounting vfat and ext2 filesystems.

Quoted 7 lines
Quoted 5 lines

Guess which device driver feels a bit chatty?

...

VFS: Can't find ext3 filesystem on dev loop0.

That's only printed if the sys_mount() caller set MS_VERBOSE in `flags'.

Well, I didn't set it from userspace. Stuck in a printf to make sure.

name /dev/loop0 vfsflags=0 0
VFS: Can't find ext3 filesystem on dev loop0.

Rob

Signature · 1 line
Never bet against the cheap plastic solution.
#8 lore raw
In reply to Theodore Ts'o
Quoted 7 lines · Theodore Ts'o
Quoted 6 lines · Andrew Morton
Quoted 5 lines

Guess which device driver feels a bit chatty?

...

VFS: Can't find ext3 filesystem on dev loop0.

Quoted 7 lines
Quoted 1 line

That's only printed if the sys_mount() caller set MS_VERBOSE in `flags'.

I should have been a bit more explict in my previous message. Actually, if you trace down the logic, it's only printed if sys_mount() __DIDN'T__ set MS_VERBOSE in 'flags'. The code in fs/super.c sets the "silent" flag if (flags & MS_VERBOSE) is non-zero. The meaning is reversed, which is counterintuitive. Hence, my patch.

Just confirming: you aren't proposing a change to kernel behavior, instead the the busybox mount program should set MS_VERBOSE/MS_SILENT by default if it wants to avoid these messages appearing on the console?

Rob

Signature · 1 line
Never bet against the cheap plastic solution.
#4 lore raw
In reply to Rob Landley
Quoted 23 lines · On Tue, 14 Mar 2006 10:20:27 -0500 Rob Landley wrote:
Quoted 22 lines · Randy.Dunlap
Quoted 20 lines · On Mon, 13 Mar 2006 22:18:39 -0500 Rob Landley wrote:

I'm making a test suite for busybox mount, which does filesystem autodetection the easy way (try all the ones in /etc/filesystems and /proc/filesystems until one of them succeeds). My test code is creating and mounting vfat and ext2 filesystems.

Guess which device driver feels a bit chatty?

PASS: mount no proc [GNUFAIL]
PASS: mount /proc
PASS: mount list1
VFS: Can't find ext3 filesystem on dev loop0.
PASS: mount vfat image (autodetect type)
ext3: No journal on filesystem on loop1
PASS: mount ext2 image (autodetect type)
PASS: mount remount ext2 image noatime
PASS: mount remount ext2 image ro remembers noatime
ext3: No journal on filesystem on loop0
PASS: umount freed loop device
PASS: mount remount nonexistent directory
PASS: mount -a no fstab

Quoted 3 lines
Quoted 1 line

Hrm, yes, 2 of those lines do come from ext3.

Three, actually.

Agreed (the VFS: line also).

---
~Randy

#9 lore raw
In reply to Rob Landley
Quoted 3 lines · Rob Landley

Just confirming: you aren't proposing a change to kernel behavior, instead the the busybox mount program should set MS_VERBOSE/MS_SILENT by default if it wants to avoid these messages appearing on the console?

Yes, correct. Normally, it is useful to have error messages show up on the console when a mount fails for whatever reason. But when you are doing autodetecton the stupid way (by trying to brute force mount every single filesystem type), the error messages get annoying. In init/do_mounts.c, it is trying to do the exact same thing, which is why it passes MS_VERBOSE (now MS_SILENT) as a mount option.

- Ted