Module Name:    src
Committed By:   riz
Date:           Wed Dec  1 17:39:21 UTC 2010

Modified Files:
        src/sbin/resize_ffs: resize_ffs.c

Log Message:
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 mhi...@.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sbin/resize_ffs/resize_ffs.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sbin/resize_ffs/resize_ffs.c
diff -u src/sbin/resize_ffs/resize_ffs.c:1.15 src/sbin/resize_ffs/resize_ffs.c:1.16
--- src/sbin/resize_ffs/resize_ffs.c:1.15	Wed Dec  1 17:33:45 2010
+++ src/sbin/resize_ffs/resize_ffs.c	Wed Dec  1 17:39:21 2010
@@ -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!");

Reply via email to