Author: trasz
Date: Mon Oct  2 11:57:00 2017
New Revision: 324199
URL: https://svnweb.freebsd.org/changeset/base/324199

Log:
  Clear G_CF_ORPHAN when attaching. This fixes cases where the same
  GEOM consumer can be orphaned, and then reattach to another provider.
  
  From a user point of view, this makes gmountver(4) work again.
  
  Reviewed by:  avg, mav
  MFC after:    2 weeks
  Sponsored by: DARPA, AFRL
  Differential Revision:        https://reviews.freebsd.org/D12228

Modified:
  head/sys/geom/geom_subr.c

Modified: head/sys/geom/geom_subr.c
==============================================================================
--- head/sys/geom/geom_subr.c   Mon Oct  2 11:55:11 2017        (r324198)
+++ head/sys/geom/geom_subr.c   Mon Oct  2 11:57:00 2017        (r324199)
@@ -828,6 +828,7 @@ g_attach(struct g_consumer *cp, struct g_provider *pp)
        g_trace(G_T_TOPOLOGY, "g_attach(%p, %p)", cp, pp);
        KASSERT(cp->provider == NULL, ("attach but attached"));
        cp->provider = pp;
+       cp->flags &= ~G_CF_ORPHAN;
        LIST_INSERT_HEAD(&pp->consumers, cp, consumers);
        error = redo_rank(cp->geom);
        if (error) {
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to