Date: Tue, 27 May 2003 17:31:13 +0200 From: Ollivier Robert <roberto@keltia.freenix.fr> To: Doug Barton <DougB@FreeBSD.org> Cc: Nate Lawson <nate@root.org> Subject: Re: cvs commit: src/sbin/newfs mkfs.c Message-ID: <20030527153113.GB22682@tara.freenix.org> In-Reply-To: <20030522165905.R2984@znfgre.qbhto.arg> References: <20030522183930.564EF37B49D@hub.freebsd.org> <20030522161035.X95941@root.org> <20030522235524.GB6396@webcom.it> <20030522165905.R2984@znfgre.qbhto.arg>
next in thread | previous in thread | raw e-mail | index | archive | help
According to Doug Barton:
> I think that's a very valid second step, and I hope someone takes it on. I
> felt that this step was much more important to accomplish prior to the
> release however.
Untested -- because don't have any UFS2 FS yet -- follows:
Index: sys/ufs/ffs/fs.h
===================================================================
RCS file: /home/ncvs/src/sys/ufs/ffs/fs.h,v
retrieving revision 1.14.2.3
diff -u -2 -I.*$Id:.* -r1.14.2.3 fs.h
--- sys/ufs/ffs/fs.h 21 Sep 2001 19:15:22 -0000 1.14.2.3
+++ sys/ufs/ffs/fs.h 27 May 2003 15:29:40 -0000
@@ -285,5 +285,8 @@
* Filesystem identification
*/
-#define FS_MAGIC 0x011954 /* the fast filesystem magic number */
+#define FS_UFS1_MAGIC 0x011954 /* UFS1 fast filesystem magic number */
+#define FS_UFS2_MAGIC 0x19540119 /* UFS2 fast filesystem magic number */
+
+#define FS_MAGIC FS_UFS1_MAGIC /* the fast filesystem magic number */
#define FS_OKAY 0x7c269d38 /* superblock checksum */
#define FS_42INODEFMT -1 /* 4.2BSD inode format */
Index: sbin/fsck/setup.c
===================================================================
RCS file: /home/ncvs/src/sbin/fsck/Attic/setup.c,v
retrieving revision 1.17.2.4
diff -u -2 -I.*$Id:.* -r1.17.2.4 setup.c
--- sbin/fsck/setup.c 24 Jun 2002 05:10:41 -0000 1.17.2.4
+++ sbin/fsck/setup.c 27 May 2003 15:24:58 -0000
@@ -333,4 +333,6 @@
* run a few consistency checks of the super block
*/
+ if (sblock.fs_magic == FS_UFS2_MAGIC)
+ { badsb(listerr, "UFS2 FS DETECTED, IGNORING"); return (0); }
if (sblock.fs_magic != FS_MAGIC)
{ badsb(listerr, "MAGIC NUMBER WRONG"); return (0); }
--
Ollivier ROBERT -=- FreeBSD: The Power to Serve! -=- roberto@keltia.freenix.fr
Darwin snuadh.freenix.org Kernel Version 6.6: Thu May 1 21:48:54 PDT 2003
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030527153113.GB22682>
