Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 24 Jul 2016 08:23:26 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-bugs@FreeBSD.org
Subject:   [Bug 211028] [GEOM][Hyper-V] gpart can't detect the new free space after the disk capacity changes
Message-ID:  <bug-211028-8-EfeYRALybZ@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-211028-8@https.bugs.freebsd.org/bugzilla/>
References:  <bug-211028-8@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D211028

--- Comment #27 from Andrey V. Elsukov <ae@FreeBSD.org> ---
(In reply to Peter Wemm from comment #26)
> On closer examination, the GPT headers on these drives have strange things
> going on.  It does look like there's a 6 sector overallocation:
> GEOM_PART: da1 was automatically resized.
>   Use `gpart commit da1` to save changes or `gpart undo da1` to revert th=
em.
> GEOM_PART: partition 3 has end offset beyond last LBA: 143374615 > 143374=
610
> GEOM_PART: integrity check failed (da1, GPT)
>=20
> However..  I am puzzled as to why this is only sometimes detected.  As I
> said in #24 above, sometimes the machine boots fine without a peep.  All 6
> drives in the machine in question are in this state.

My guess is the following, it looks like disk reported that its size decrea=
sed.
This leads to resize and integrity check in geom_part. Since integrity check
has been failed, geom is going to be withered. In the meantime disk reported
again about changed size, this event handled before geom has fully destroye=
d,
but its softc now will be NULL, so this leads to panic what you see. Probab=
ly
the following patch will fix this panic, but I'm not sure that there will n=
ot
another panic due to disappeared GPT.

Index: geom_subr.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- geom_subr.c (revision 303255)
+++ geom_subr.c (working copy)
@@ -636,7 +636,7 @@ g_resize_provider_event(void *arg, int flag)

        LIST_FOREACH_SAFE(cp, &pp->consumers, consumers, cp2) {
                gp =3D cp->geom;
-               if (gp->resize !=3D NULL)
+               if ((gp->flags & G_GEOM_WITHER) =3D=3D 0 && gp->resize !=3D=
 NULL)
                        gp->resize(cp);
        }

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-211028-8-EfeYRALybZ>