Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/ufs/ffs add checks for a couple of botched superblock up...



details:   https://anonhg.NetBSD.org/src/rev/cce4c9895aa1
branches:  trunk
changeset: 557570:cce4c9895aa1
user:      dbj <dbj%NetBSD.org@localhost>
date:      Mon Jan 12 05:49:03 2004 +0000

description:
add checks for a couple of botched superblock upgrade cases
and report a warning with repair references.

diffstat:

 sys/ufs/ffs/ffs_vfsops.c |  29 +++++++++++++++++++++++++++--
 1 files changed, 27 insertions(+), 2 deletions(-)

diffs (54 lines):

diff -r 7f95bd445e4b -r cce4c9895aa1 sys/ufs/ffs/ffs_vfsops.c
--- a/sys/ufs/ffs/ffs_vfsops.c  Mon Jan 12 05:25:39 2004 +0000
+++ b/sys/ufs/ffs/ffs_vfsops.c  Mon Jan 12 05:49:03 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ffs_vfsops.c,v 1.132 2004/01/10 16:23:36 hannken Exp $ */
+/*     $NetBSD: ffs_vfsops.c,v 1.133 2004/01/12 05:49:03 dbj Exp $     */
 
 /*
  * Copyright (c) 1989, 1991, 1993, 1994
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ffs_vfsops.c,v 1.132 2004/01/10 16:23:36 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ffs_vfsops.c,v 1.133 2004/01/12 05:49:03 dbj Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_ffs.h"
@@ -954,10 +954,35 @@
        off_t maxfilesize;
        int32_t *extrasave;
 
+       /* XXX This warning should be removed before the next release. -- dbj */
+       if (fs->fs_flags & 0x40000000) {
+               printf("WARNING: possible botched superblock upgrade detected\n"
+                   "on filesystem previously mounted on %s\n"
+                   "Extra bits discovered in fs_flags on filesystem (0x%08x)\n"
+                   "Consider running the program mentioned in\n"
+                   "http://mail-index.netbsd.org/tech-kern/2003/10/07/0005.html\n";,
+                   fs->fs_fsmnt, fs->fs_flags);
+       }
+
        if ((fs->fs_magic != FS_UFS1_MAGIC) ||
            (fs->fs_old_flags & FS_FLAGS_UPDATED))
                return;
 
+       /* XXX This warning should be removed before the next release. -- dbj */
+       if (fs->fs_maxbsize == fs->fs_bsize) {
+               printf("WARNING: possible botched superblock upgrade detected\n"
+                   "on filesystem previously mounted on %s\n"
+                   "fs_bsize == fs_maxbsize (0x%08x) but FS_FLAGS_UPDATED is not set\n"
+                   "Test your filesystem by running fsck_ffs -n -f on it.\n"
+                   "If it reports:\n"
+                   "``VALUES IN SUPER BLOCK DISAGREE WITH THOSE IN FIRST ALTERNATE''\n"
+                   "you should be able to recover with fsck_ffs -f -b 32\n"
+                   "See the file src/UPDATING or\n"
+                   "http://mail-index.netbsd.org/current-users/2004/01/11/0022.html\n";
+                   "for more details\n",
+                   fs->fs_fsmnt, fs->fs_maxbsize);
+       }
+
        if (!ump->um_oldfscompat)
                ump->um_oldfscompat = malloc(512 + 3*sizeof(int32_t),
                    M_UFSMNT, M_WAITOK);



Home | Main Index | Thread Index | Old Index