Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 9 Feb 1997 13:53:34 -0500 (EST)
From:      Thomas David Rivers <ponds!rivers@dg-rtp.dg.com>
To:        ponds!root.com!dg, ponds!freefall.cdrom.com!freebsd-hackers, ponds!uriah.heep.sax.de!joerg_wunsch, ponds!lambert.org!terry
Subject:   daily panics, ffs_valloc: dup alloc - Good news!
Message-ID:  <199702091853.NAA24339@lakes.water.net>

next in thread | raw e-mail | index | archive | help

As I said before; I would test our Joerg's supposition.  I'm happy to
report it seems to be right on the money! (Good work!)

I built a new "newfs", with NTRACKS bumped to 2 and NSECTORS dropped 
to 2048.

It worked like a champ!  No more panic: ffs_valloc: dup alloc.

I'd say the problem is that the underlying code can't handle one
track (head).

We should probably go ahead and use this work-around in 2.1.7 and
2.2.  Perhaps, if we're so inclined, we can determine what a
better fix would be to keep the 1 track idea.  [It could possibly
be simply setting fs->fs_cgmask to 0 if the number of tracks is 1; but 
I'm not sure.]  That investigation could wait until after 2.2 and
2.1.7.

Thanks to everyone for sticking with me on this!

[Now, the question becomes how to adjust an existing file system; which
I don't think can be done :-) ]

Here's my (simple) patch to newfs.c...

	- Dave Rivers -

*** newfs.c.ori	Sun Sep 17 05:56:20 1995
--- newfs.c	Sun Feb  9 13:51:46 1997
***************
*** 150,160 ****
   * We do this by saying one head, with a lot of sectors on it.
   * The number of sectors are used to determine the size of a cyl-group.
   * Kirk suggested one or two meg per "cylinder" so we say two.
   */
  
! #define NTRACKS		1	/* number of heads */
  
! #define NSECTORS	4096	/* number of sectors */
  
  int	mfs;			/* run as the memory based filesystem */
  int	Nflag;			/* run without writing file system */
--- 150,166 ----
   * We do this by saying one head, with a lot of sectors on it.
   * The number of sectors are used to determine the size of a cyl-group.
   * Kirk suggested one or two meg per "cylinder" so we say two.
+  *
+  *  NB: Although it's tempting to make NTRACKS 1; the underlying file
+  *      system code will then receive an fs_cgmask of 0xffffffff which
+  *      will make for ino<->block calculations; causing "dup alloc" and
+  *      other panics.  Until that problem is addressed, we pretend to have
+  *      two heads (two heads are better than one :-) .)
   */
  
! #define NTRACKS		2	/* number of heads */
  
! #define NSECTORS	2048	/* number of sectors */
  
  int	mfs;			/* run as the memory based filesystem */
  int	Nflag;			/* run without writing file system */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199702091853.NAA24339>