Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 01 Oct 2009 09:24:10 -0700
From:      Matthew Jacob <mj@feral.com>
To:        freebsd-fs@FreeBSD.org
Subject:   review needed for a simple fix to growfs
Message-ID:  <4AC4D7AA.1080005@feral.com>

next in thread | raw e-mail | index | archive | help
I have a simple fix to growfs that eliminates some issues Doug was 
seeing. I probably don't know enough to know some of the implications of 
the change and wonder if anyone would care to comment on it?

The symptoms would be fsck failures on the grown filesystem- my take is 
that it was because the new cylinder groups were being initialized as 
having all the inodes allocated. This is puzzling me because, like, how 
could this ever have worked?

It was trivial for me to reproduce- see 
http://people.freebsd.org/~mjacob/growfs.failure.txt.

The second change, btw, is not essential- it just adjusts maxino down if 
you had to drop the number of cylinder groups down.


Index: growfs.c
===================================================================
--- growfs.c    (revision 197658)
+++ growfs.c    (working copy)
@@ -401,7 +401,6 @@
        acg.cg_magic = CG_MAGIC;
        acg.cg_cgx = cylno;
        acg.cg_niblk = sblock.fs_ipg;
-       acg.cg_initediblk = sblock.fs_ipg;
        acg.cg_ndblk = dmax - cbase;
        if (sblock.fs_contigsumsize > 0)
                acg.cg_nclusterblks = acg.cg_ndblk / sblock.fs_frag;
@@ -2217,6 +2216,7 @@
                printf("Warning: %jd sector(s) cannot be allocated.\n",
                    (intmax_t)fsbtodb(&sblock, sblock.fs_size % 
sblock.fs_fpg));
                sblock.fs_size = sblock.fs_ncg * sblock.fs_fpg;
+               maxino -= sblock.fs_ipg;
        }

        /*




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