Re: [uPATCH] refuse plain ufs mount

From: GOTO Masanori
Date: Tue Jan 27 2004 - 00:06:29 EST


At Tue, 27 Jan 2004 05:07:50 +0100 (MET),
Andries.Brouwer@xxxxxx wrote:
> From: Linus Torvalds <torvalds@xxxxxxxx>
>
> > But you see, it wasn't the user at all, and it wasn't a ufs filesystem.
> > It is kernel probing that causes error messages. That is unwanted.
> > So, your version is wrong.
>
> Yes.
>
> However, I think the _real_ bug is that we have reiserfs near the tail of
> filesystems to try.
>
> Can you test that alternate patch instead?
>
> Funny how we alternate - when I choose the pure, theoretical point of view
> you prefer practice, when I prefer practice you become pure.
>
> This time you prefer practice: the list of filesystems is full of garbage
> and good filesystems should be near the top.
> I prefer theory: the kernel should not probe at all, so everybody who
> forgets rootfstype= gets what he deserves.
>
> Be that as it may - below a patch as I suppose you had in mind.
> I don't like it very much. Ordering constraints in makefiles are bad.

>From the user point of view, I think it's weilcome that "popular"
filesystems like reiserfs used for rootfs is moved upwards, because
boot up speed is accelerated. It's difficult to define what "popular"
is, but apparently hugetlbfs should be lower than reiserfs. So your
patch seems fine, I think.

> Have not compiled or tested.
> You can apply it I suppose, but after doing so my earlier patch is still
> meaningful. Maybe you should also apply that (and the Doc update).

I misunderstand what the real problem is.

The problem as you previously wrote was that UFS does not use
ufs_fill_super third argument "silent" value, so some warning messages
are scattered during boot up time. I agree that this is exactly just
a noise. Andries removed those warnings instead of using "silent",
but in fact such messages are important for users who want to mount
ufs filesystem to tell for kernel the proper UFS type. To be honest,
I sometimes forget to add "ufstype=" option to mount UFS, so this
warning is useful for me. I attached patch which uses "silent" value
for this problem. I checked this patch which removes all scattered
UFS messages from boot up screen. I think this one is acceptable for
even Andries instead of your UFS patch, is it OK?

Regards,
-- gotom


--- fs/ufs/super.c.org 2003-10-20 12:50:24.000000000 +0900
+++ fs/ufs/super.c 2004-01-27 13:26:05.000000000 +0900
@@ -516,7 +516,7 @@
printk("wrong mount options\n");
goto failed;
}
- if (!(sbi->s_mount_opt & UFS_MOUNT_UFSTYPE)) {
+ if (!(sbi->s_mount_opt & UFS_MOUNT_UFSTYPE) && !silent) {
printk("You didn't specify the type of your ufs filesystem\n\n"
"mount -t ufs -o ufstype="
"sun|sunx86|44bsd|old|hp|nextstep|netxstep-cd|openstep ...\n\n"
@@ -575,7 +575,7 @@
uspi->s_sbsize = super_block_size = 2048;
uspi->s_sbbase = 0;
flags |= UFS_DE_OLD | UFS_UID_OLD | UFS_ST_OLD | UFS_CG_OLD;
- if (!(sb->s_flags & MS_RDONLY)) {
+ if (!(sb->s_flags & MS_RDONLY) && !silent) {
printk(KERN_INFO "ufstype=old is supported read-only\n");
sb->s_flags |= MS_RDONLY;
}
@@ -589,7 +589,7 @@
uspi->s_sbsize = super_block_size = 2048;
uspi->s_sbbase = 0;
flags |= UFS_DE_OLD | UFS_UID_OLD | UFS_ST_OLD | UFS_CG_OLD;
- if (!(sb->s_flags & MS_RDONLY)) {
+ if (!(sb->s_flags & MS_RDONLY) && !silent) {
printk(KERN_INFO "ufstype=nextstep is supported read-only\n");
sb->s_flags |= MS_RDONLY;
}
@@ -603,7 +603,7 @@
uspi->s_sbsize = super_block_size = 2048;
uspi->s_sbbase = 0;
flags |= UFS_DE_OLD | UFS_UID_OLD | UFS_ST_OLD | UFS_CG_OLD;
- if (!(sb->s_flags & MS_RDONLY)) {
+ if (!(sb->s_flags & MS_RDONLY) && !silent) {
printk(KERN_INFO "ufstype=nextstep-cd is supported read-only\n");
sb->s_flags |= MS_RDONLY;
}
@@ -617,7 +617,7 @@
uspi->s_sbsize = super_block_size = 2048;
uspi->s_sbbase = 0;
flags |= UFS_DE_44BSD | UFS_UID_44BSD | UFS_ST_44BSD | UFS_CG_44BSD;
- if (!(sb->s_flags & MS_RDONLY)) {
+ if (!(sb->s_flags & MS_RDONLY) && !silent) {
printk(KERN_INFO "ufstype=openstep is supported read-only\n");
sb->s_flags |= MS_RDONLY;
}
@@ -631,13 +631,14 @@
uspi->s_sbsize = super_block_size = 2048;
uspi->s_sbbase = 0;
flags |= UFS_DE_OLD | UFS_UID_OLD | UFS_ST_OLD | UFS_CG_OLD;
- if (!(sb->s_flags & MS_RDONLY)) {
+ if (!(sb->s_flags & MS_RDONLY) && !silent) {
printk(KERN_INFO "ufstype=hp is supported read-only\n");
sb->s_flags |= MS_RDONLY;
}
break;
default:
- printk("unknown ufstype\n");
+ if (!silent)
+ printk("unknown ufstype\n");
goto failed;
}

@@ -687,7 +688,8 @@
uspi->s_sbbase += 8;
goto again;
}
- printk("ufs_read_super: bad magic number\n");
+ if (!silent)
+ printk("ufs_read_super: bad magic number\n");
goto failed;

magic_found:
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/