Source-Changes-HG archive

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

[src/trunk]: src/sbin/resize_ffs Dunno why this code is playing 'hunt the sup...



details:   https://anonhg.NetBSD.org/src/rev/887b2715d4ea
branches:  trunk
changeset: 559677:887b2715d4ea
user:      dsl <dsl%NetBSD.org@localhost>
date:      Sun Mar 21 21:02:01 2004 +0000

description:
Dunno why this code is playing 'hunt the superblock', but stop it
finding an ffsv1 sb at 64k.
Also stop it playing with fs that have 'FS_FLAGS_UPDATED' set.
It certainly doesn't act on that falg, and my guess is that it is
playing the pre-ffsv2 fs.
Fixes part of PR kern/24809

diffstat:

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

diffs (20 lines):

diff -r ea369da43c7b -r 887b2715d4ea sbin/resize_ffs/resize_ffs.c
--- a/sbin/resize_ffs/resize_ffs.c      Sun Mar 21 20:30:38 2004 +0000
+++ b/sbin/resize_ffs/resize_ffs.c      Sun Mar 21 21:02:01 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: resize_ffs.c,v 1.6 2004/01/05 23:23:33 jmmv Exp $      */
+/*     $NetBSD: resize_ffs.c,v 1.7 2004/03/21 21:02:01 dsl Exp $       */
 /* From sources sent on February 17, 2003 */
 /*-
  * As its sole author, I explicitly place this code in the public
@@ -1844,6 +1844,10 @@
                readat(where, oldsb, SBLOCKSIZE);
                if (oldsb->fs_magic == FS_UFS1_MAGIC)
                        break;
+               if (where == SBLOCK_UFS2)
+                       continue;
+               if (oldsb->fs_old_flags & FS_FLAGS_UPDATED)
+                       err(1, "Cannot resize ffsv2 format suberblock!");
        }
        if (where == (off_t)-1)
                errx(1, "Bad magic number");



Home | Main Index | Thread Index | Old Index