[Bug 211028] [GEOM][Hyper-V] gpart can't detect the new free space after the disk capacity changes

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Sun Jul 24 08:23:26 UTC 2016


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=211028

--- Comment #27 from Andrey V. Elsukov <ae at 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 them.
> GEOM_PART: partition 3 has end offset beyond last LBA: 143374615 > 143374610
> GEOM_PART: integrity check failed (da1, GPT)
> 
> 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 decreased.
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 destroyed,
but its softc now will be NULL, so this leads to panic what you see. Probably
the following patch will fix this panic, but I'm not sure that there will not
another panic due to disappeared GPT.

Index: geom_subr.c
===================================================================
--- 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 = cp->geom;
-               if (gp->resize != NULL)
+               if ((gp->flags & G_GEOM_WITHER) == 0 && gp->resize != NULL)
                        gp->resize(cp);
        }

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


More information about the freebsd-bugs mailing list