Source-Changes-HG archive

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

[src/trunk]: src/sbin/fsck_ffs If an alternate superblock is used, update the...



details:   https://anonhg.NetBSD.org/src/rev/4b6a5b29acbd
branches:  trunk
changeset: 545691:4b6a5b29acbd
user:      fvdl <fvdl%NetBSD.org@localhost>
date:      Mon Apr 14 18:50:52 2003 +0000

description:
If an alternate superblock is used, update the standard one correctly.

diffstat:

 sbin/fsck_ffs/utilities.c |  14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diffs (36 lines):

diff -r 5668a2a3c745 -r 4b6a5b29acbd sbin/fsck_ffs/utilities.c
--- a/sbin/fsck_ffs/utilities.c Mon Apr 14 18:34:26 2003 +0000
+++ b/sbin/fsck_ffs/utilities.c Mon Apr 14 18:50:52 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: utilities.c,v 1.38 2003/04/13 10:22:40 yamt Exp $      */
+/*     $NetBSD: utilities.c,v 1.39 2003/04/14 18:50:52 fvdl Exp $      */
 
 /*
  * Copyright (c) 1980, 1986, 1993
@@ -38,7 +38,7 @@
 #if 0
 static char sccsid[] = "@(#)utilities.c        8.6 (Berkeley) 5/19/95";
 #else
-__RCSID("$NetBSD: utilities.c,v 1.38 2003/04/13 10:22:40 yamt Exp $");
+__RCSID("$NetBSD: utilities.c,v 1.39 2003/04/14 18:50:52 fvdl Exp $");
 #endif
 #endif /* not lint */
 
@@ -279,12 +279,12 @@
                return;
        }
        flush(fswritefd, &sblk);
-       if (havesb && is_ufs2 && sblk.b_bno !=
-           sblock->fs_sblockloc / dev_bsize &&
+       if (havesb && bflag != 0 &&
            !preen && reply("UPDATE STANDARD SUPERBLOCK")) {
-               printf("sblk.b_bno %lld sblockloc %lld\n",
-                   (long long)sblk.b_bno, (long long)sblock->fs_sblockloc);
-               sblk.b_bno = sblock->fs_sblockloc / dev_bsize;
+               if (!is_ufs2 && (sblock->fs_old_flags & FS_FLAGS_UPDATED) == 0)
+                       sblk.b_bno = SBLOCK_UFS1 / dev_bsize;
+               else
+                       sblk.b_bno = sblock->fs_sblockloc / dev_bsize;
                sbdirty();
                flush(fswritefd, &sblk);
        }



Home | Main Index | Thread Index | Old Index