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

--- Comment #18 from Andrey V. Elsukov <a...@freebsd.org> ---
(In reply to Dexuan Cui from comment #17)
> (In reply to Dexuan Cui from comment #16)
> Please review the attached patch. It may be a little ugly since I'm pretty
> new to GEOM code... Please suggest how we should fix the issue in a better
> way.

GEOM serves not only the disks, you can break g_provider_resize() for other
types of providers.
Can you test this patch instead?
Index: geom_disk.c
===================================================================
--- geom_disk.c (revision 302840)
+++ geom_disk.c (working copy)
@@ -126,7 +126,6 @@ g_disk_access(struct g_provider *pp, int r, int w,
                        if (error != 0)
                                return (error);
                }
-               pp->mediasize = dp->d_mediasize;
                pp->sectorsize = dp->d_sectorsize;
                if (dp->d_maxsize == 0) {
                        printf("WARNING: Disk drive %s%d has no d_maxsize\n",
@@ -143,6 +142,7 @@ g_disk_access(struct g_provider *pp, int r, int w,
                pp->stripeoffset = dp->d_stripeoffset;
                pp->stripesize = dp->d_stripesize;
                dp->d_flags |= DISKFLAG_OPEN;
+               g_resize_provider(pp, dp->d_mediasize);
        } else if ((pp->acr + pp->acw + pp->ace) > 0 && (r + w + e) == 0) {
                if (dp->d_close != NULL) {
                        error = dp->d_close(dp);

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
freebsd-geom@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-geom
To unsubscribe, send any mail to "freebsd-geom-unsubscr...@freebsd.org"

Reply via email to