Source-Changes-HG archive

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

[src/trunk]: src/usr.sbin/installboot When searching for the superblock, don'...



details:   https://anonhg.NetBSD.org/src/rev/301e5b3326ca
branches:  trunk
changeset: 559679:301e5b3326ca
user:      dsl <dsl%NetBSD.org@localhost>
date:      Sun Mar 21 21:18:40 2004 +0000

description:
When searching for the superblock, don't pick an ffsv1 superblock from the
location where we expect to find an ffsv2 superblock.
It could be the first alternate for a ffsv1 filesystem with 64k blocks.
Fixes part of PR kern/24809

diffstat:

 usr.sbin/installboot/ffs.c |  11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diffs (42 lines):

diff -r 4423f37a02c9 -r 301e5b3326ca usr.sbin/installboot/ffs.c
--- a/usr.sbin/installboot/ffs.c        Sun Mar 21 21:08:08 2004 +0000
+++ b/usr.sbin/installboot/ffs.c        Sun Mar 21 21:18:40 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ffs.c,v 1.13 2003/10/06 02:39:04 lukem Exp $   */
+/*     $NetBSD: ffs.c,v 1.14 2004/03/21 21:18:40 dsl Exp $     */
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
 
 #include <sys/cdefs.h>
 #if defined(__RCSID) && !defined(__lint)
-__RCSID("$NetBSD: ffs.c,v 1.13 2003/10/06 02:39:04 lukem Exp $");
+__RCSID("$NetBSD: ffs.c,v 1.14 2004/03/21 21:18:40 dsl Exp $");
 #endif /* !__lint */
 
 #include <sys/param.h>
@@ -469,7 +469,7 @@
                        params->fstype->needswap = 0;
                        params->fstype->blocksize = fs->fs_bsize;
                        params->fstype->sblockloc = loc;
-                       return (1);
+                       break;
                case FS_UFS2_MAGIC_SWAPPED:
                        is_ufs2 = 1;
                        /* FALLTHROUGH */
@@ -477,10 +477,13 @@
                        params->fstype->needswap = 1;
                        params->fstype->blocksize = bswap32(fs->fs_bsize);
                        params->fstype->sblockloc = loc;
-                       return (1);
+                       break;
                default:
                        continue;
                }
+               if (!is_ufs2 && sblock_try[i] == SBLOCK_UFS2)
+                       continue;
+               return 1;
        }
 
        return (0);



Home | Main Index | Thread Index | Old Index