2006-03-14 03:18:21

by Rob Landley

[permalink] [raw]
Subject: How do I get the ext3 driver to shut up?

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
--
Never bet against the cheap plastic solution.


2006-03-14 03:28:42

by Randy Dunlap

[permalink] [raw]
Subject: Re: How do I get the ext3 driver to shut up?

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

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

2006-03-14 07:16:36

by Andrew Morton

[permalink] [raw]
Subject: Re: How do I get the ext3 driver to shut up?

Rob Landley <[email protected]> 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?
>
> ...
>
> VFS: Can't find ext3 filesystem on dev loop0.

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

2006-03-14 13:00:00

by Theodore Ts'o

[permalink] [raw]
Subject: [PATCH] Fix backwards meaning of MS_VERBOSE

On Mon, Mar 13, 2006 at 11:14:07PM -0800, Andrew Morton wrote:
> > 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?

Signed-off-by: "Theodore Ts'o" <[email protected]>

Index: 2.6.16-rc5/include/linux/fs.h
===================================================================
--- 2.6.16-rc5.orig/include/linux/fs.h 2006-03-14 07:31:33.000000000 -0500
+++ 2.6.16-rc5/include/linux/fs.h 2006-03-14 07:32:10.000000000 -0500
@@ -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 */
Index: 2.6.16-rc5/fs/super.c
===================================================================
--- 2.6.16-rc5.orig/fs/super.c 2006-03-14 07:31:33.000000000 -0500
+++ 2.6.16-rc5/fs/super.c 2006-03-14 07:54:38.000000000 -0500
@@ -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);
Index: 2.6.16-rc5/fs/afs/super.c
===================================================================
--- 2.6.16-rc5.orig/fs/afs/super.c 2006-03-14 07:31:33.000000000 -0500
+++ 2.6.16-rc5/fs/afs/super.c 2006-03-14 07:32:10.000000000 -0500
@@ -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);
Index: 2.6.16-rc5/fs/cifs/cifsfs.c
===================================================================
--- 2.6.16-rc5.orig/fs/cifs/cifsfs.c 2006-03-14 07:31:33.000000000 -0500
+++ 2.6.16-rc5/fs/cifs/cifsfs.c 2006-03-14 07:32:10.000000000 -0500
@@ -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);
Index: 2.6.16-rc5/fs/jffs2/super.c
===================================================================
--- 2.6.16-rc5.orig/fs/jffs2/super.c 2006-03-14 07:31:33.000000000 -0500
+++ 2.6.16-rc5/fs/jffs2/super.c 2006-03-14 07:54:08.000000000 -0500
@@ -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;
Index: 2.6.16-rc5/fs/nfs/inode.c
===================================================================
--- 2.6.16-rc5.orig/fs/nfs/inode.c 2006-03-14 07:31:33.000000000 -0500
+++ 2.6.16-rc5/fs/nfs/inode.c 2006-03-14 07:53:28.000000000 -0500
@@ -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);
Index: 2.6.16-rc5/init/do_mounts.c
===================================================================
--- 2.6.16-rc5.orig/init/do_mounts.c 2006-03-11 22:17:00.000000000 -0500
+++ 2.6.16-rc5/init/do_mounts.c 2006-03-14 07:56:49.000000000 -0500
@@ -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];

2006-03-14 14:12:01

by marcos cunha

[permalink] [raw]
Subject: Re: How do I get the ext3 driver to shut up?

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

On 3/14/06, Randy.Dunlap <[email protected]> wrote:
> 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
>
> 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/
>

2006-03-14 14:48:53

by Theodore Ts'o

[permalink] [raw]
Subject: Re: How do I get the ext3 driver to shut up?

On Mon, Mar 13, 2006 at 11:14:07PM -0800, Andrew Morton wrote:
> > 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

2006-03-14 16:32:37

by Rob Landley

[permalink] [raw]
Subject: Re: How do I get the ext3 driver to shut up?

On Monday 13 March 2006 10:30 pm, Randy.Dunlap wrote:
> 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
>
> Hrm, yes, 2 of those lines do come from ext3.

Three, actually.

> 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
--
Never bet against the cheap plastic solution.


Attachments:
(No filename) (2.07 kB)
mounttests.tgz (3.67 kB)
Download all attachments

2006-03-14 16:32:45

by Rob Landley

[permalink] [raw]
Subject: Re: How do I get the ext3 driver to shut up?

On Tuesday 14 March 2006 2:14 am, Andrew Morton wrote:
> Rob Landley <[email protected]> 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?
> >
> > ...
> >
> > 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
--
Never bet against the cheap plastic solution.

2006-03-14 16:41:46

by Rob Landley

[permalink] [raw]
Subject: Re: How do I get the ext3 driver to shut up?

On Tuesday 14 March 2006 9:48 am, Theodore Ts'o wrote:
> On Mon, Mar 13, 2006 at 11:14:07PM -0800, Andrew Morton wrote:
> > > 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.

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
--
Never bet against the cheap plastic solution.

2006-03-14 17:25:08

by Randy Dunlap

[permalink] [raw]
Subject: Re: How do I get the ext3 driver to shut up?

On Tue, 14 Mar 2006 10:20:27 -0500 Rob Landley wrote:

> On Monday 13 March 2006 10:30 pm, Randy.Dunlap wrote:
> > 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
> >
> > Hrm, yes, 2 of those lines do come from ext3.
>
> Three, actually.

Agreed (the VFS: line also).

---
~Randy

2006-03-14 20:09:28

by Theodore Ts'o

[permalink] [raw]
Subject: Re: How do I get the ext3 driver to shut up?

On Tue, Mar 14, 2006 at 11:41:53AM -0500, Rob Landley wrote:
> 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