Source-Changes-HG archive

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

[src/netbsd-1-4]: src/sbin/newfs_lfs Pull up revision 1.5:



details:   https://anonhg.NetBSD.org/src/rev/592c46f6da1e
branches:  netbsd-1-4
changeset: 469331:592c46f6da1e
user:      he <he%NetBSD.org@localhost>
date:      Sun Sep 05 14:57:34 1999 +0000

description:
Pull up revision 1.5:
  Refuse to create a file system with too few segments, which
  would prevent the cleaner from working, fixing PR#7623.  (perseant)

diffstat:

 sbin/newfs_lfs/lfs.c |  13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

diffs (41 lines):

diff -r 0fd5341ff0bb -r 592c46f6da1e sbin/newfs_lfs/lfs.c
--- a/sbin/newfs_lfs/lfs.c      Fri Sep 03 09:51:07 1999 +0000
+++ b/sbin/newfs_lfs/lfs.c      Sun Sep 05 14:57:34 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: lfs.c,v 1.3.2.1 1999/06/25 21:02:26 perry Exp $        */
+/*     $NetBSD: lfs.c,v 1.3.2.2 1999/09/05 14:57:34 he Exp $   */
 
 /*-
  * Copyright (c) 1991, 1993
@@ -38,7 +38,7 @@
 #if 0
 static char sccsid[] = "@(#)lfs.c      8.5 (Berkeley) 5/24/95";
 #else
-__RCSID("$NetBSD: lfs.c,v 1.3.2.1 1999/06/25 21:02:26 perry Exp $");
+__RCSID("$NetBSD: lfs.c,v 1.3.2.2 1999/09/05 14:57:34 he Exp $");
 #endif
 #endif /* not lint */
 
@@ -290,6 +290,9 @@
        lfsp->lfs_nclean = lfsp->lfs_nseg = lfsp->lfs_dsize / lfsp->lfs_ssize;
        lfsp->lfs_maxfilesize = maxtable[lfsp->lfs_bshift] << lfsp->lfs_bshift;
 
+       if(lfsp->lfs_nseg < MIN_FREE_SEGS + 1)
+               fatal("Could not allocate %d segments; please decrease the segment size\n", MIN_FREE_SEGS+1);
+
        /* 
         * The number of free blocks is set from the number of segments times
         * the segment size - MIN_FREE_SEGS (that we never write because we need to make
@@ -324,6 +327,12 @@
                        break;
                lfsp->lfs_sboffs[i] = sb_addr;
        }
+
+       /* We need >= 2 superblocks */
+       if(lfsp->lfs_sboffs[1] == 0x0) {
+               fatal("Could not assign a disk adress for the second superblock.\nPlease decrease the segment size.\n");
+       }
+
        last_sb_addr = lfsp->lfs_sboffs[i - 1];
        lfsp->lfs_lastseg = lfsp->lfs_sboffs[0];
        lfsp->lfs_nextseg = 



Home | Main Index | Thread Index | Old Index