Source-Changes-HG archive

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

[src/trunk]: src/sbin/resize_ffs Do not look for a v1 file system at SBLOCK_U...



details:   https://anonhg.NetBSD.org/src/rev/257b3adb4070
branches:  trunk
changeset: 759202:257b3adb4070
user:      riz <riz%NetBSD.org@localhost>
date:      Wed Dec 01 17:39:21 2010 +0000

description:
Do not look for a v1 file system at SBLOCK_UFS2, as this gets the wrong
superblock (first alternate) for a file system with 64k blocks.
Spotted by mhitch@.

diffstat:

 sbin/resize_ffs/resize_ffs.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (22 lines):

diff -r 9a496130be3e -r 257b3adb4070 sbin/resize_ffs/resize_ffs.c
--- a/sbin/resize_ffs/resize_ffs.c      Wed Dec 01 17:33:45 2010 +0000
+++ b/sbin/resize_ffs/resize_ffs.c      Wed Dec 01 17:39:21 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: resize_ffs.c,v 1.15 2010/12/01 17:33:45 riz Exp $      */
+/*     $NetBSD: resize_ffs.c,v 1.16 2010/12/01 17:39:21 riz Exp $      */
 /* From sources sent on February 17, 2003 */
 /*-
  * As its sole author, I explicitly place this code in the public
@@ -1910,10 +1910,10 @@
        newsb = (struct fs *) (SBLOCKSIZE + (char *) &sbbuf);
        for (where = search[i = 0]; search[i] != -1; where = search[++i]) {
                readat(where / DEV_BSIZE, oldsb, SBLOCKSIZE);
+               if (where == SBLOCK_UFS2 && (oldsb->fs_magic == FS_UFS1_MAGIC))
+                       continue;
                if (oldsb->fs_magic == FS_UFS1_MAGIC)
                        break;
-               if (where == SBLOCK_UFS2)
-                       continue;
                if (oldsb->fs_old_flags & FS_FLAGS_UPDATED)
                        err(EXIT_FAILURE,
                            "Can't resize ffsv2 format superblock!");



Home | Main Index | Thread Index | Old Index