Re: [uPATCH] refuse plain ufs mount

From: GOTO Masanori
Date: Wed Jan 28 2004 - 19:15:04 EST


At Wed, 28 Jan 2004 22:24:30 +0000,
Example wrote:
> There's a semantic change introduced by this patch.
> I don't know enough about UFS to call it a bug, but it
> certainly looks suspicious.

Exactly. Thanks for your check, and I'm sorry the previous patch
which includes such wrong change. I attached the update one.

Regards,
-- gotom


--- fs/ufs/super.c.org 2003-10-20 12:50:24.000000000 +0900
+++ fs/ufs/super.c 2004-01-29 08:34:15.000000000 +0900
@@ -517,11 +517,12 @@
goto failed;
}
if (!(sbi->s_mount_opt & UFS_MOUNT_UFSTYPE)) {
- 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"
- ">>>WARNING<<< Wrong ufstype may corrupt your filesystem, "
- "default is ufstype=old\n");
+ if (!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"
+ ">>>WARNING<<< Wrong ufstype may corrupt your filesystem, "
+ "default is ufstype=old\n");
ufs_set_opt (sbi->s_mount_opt, UFSTYPE_OLD);
}

@@ -576,7 +577,8 @@
uspi->s_sbbase = 0;
flags |= UFS_DE_OLD | UFS_UID_OLD | UFS_ST_OLD | UFS_CG_OLD;
if (!(sb->s_flags & MS_RDONLY)) {
- printk(KERN_INFO "ufstype=old is supported read-only\n");
+ if (!silent)
+ printk(KERN_INFO "ufstype=old is supported read-only\n");
sb->s_flags |= MS_RDONLY;
}
break;
@@ -590,7 +592,8 @@
uspi->s_sbbase = 0;
flags |= UFS_DE_OLD | UFS_UID_OLD | UFS_ST_OLD | UFS_CG_OLD;
if (!(sb->s_flags & MS_RDONLY)) {
- printk(KERN_INFO "ufstype=nextstep is supported read-only\n");
+ if (!silent)
+ printk(KERN_INFO "ufstype=nextstep is supported read-only\n");
sb->s_flags |= MS_RDONLY;
}
break;
@@ -604,7 +607,8 @@
uspi->s_sbbase = 0;
flags |= UFS_DE_OLD | UFS_UID_OLD | UFS_ST_OLD | UFS_CG_OLD;
if (!(sb->s_flags & MS_RDONLY)) {
- printk(KERN_INFO "ufstype=nextstep-cd is supported read-only\n");
+ if (!silent)
+ printk(KERN_INFO "ufstype=nextstep-cd is supported read-only\n");
sb->s_flags |= MS_RDONLY;
}
break;
@@ -618,7 +622,8 @@
uspi->s_sbbase = 0;
flags |= UFS_DE_44BSD | UFS_UID_44BSD | UFS_ST_44BSD | UFS_CG_44BSD;
if (!(sb->s_flags & MS_RDONLY)) {
- printk(KERN_INFO "ufstype=openstep is supported read-only\n");
+ if (!silent)
+ printk(KERN_INFO "ufstype=openstep is supported read-only\n");
sb->s_flags |= MS_RDONLY;
}
break;
@@ -632,12 +637,14 @@
uspi->s_sbbase = 0;
flags |= UFS_DE_OLD | UFS_UID_OLD | UFS_ST_OLD | UFS_CG_OLD;
if (!(sb->s_flags & MS_RDONLY)) {
- printk(KERN_INFO "ufstype=hp is supported read-only\n");
+ if (!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 +694,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/