Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 25 Oct 2012 07:28:31 +0000
From:      "Poul-Henning Kamp" <phk@phk.freebsd.dk>
To:        Andriy Gapon <avg@FreeBSD.org>
Cc:        freebsd-geom@FreeBSD.org
Subject:   Re: geom access method and g_topology_lock
Message-ID:  <28185.1351150111@critter.freebsd.dk>
In-Reply-To: <5088E0E0.2080307@FreeBSD.org>
References:  <5088E0E0.2080307@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
--------
In message <5088E0E0.2080307@FreeBSD.org>, Andriy Gapon writes:

>The problem is that the following innocent-looking code may become not quite so
>innocent:
>
>g_topology_assert();
>g_access(cp, -1, 0, -1);
>/* a lot might have happened between these two lines */
>g_detach(cp);
>g_destroy_consumer(cp);


It really depends what "a lot" actually is.

It is perfectly legal and acceptable for a consumer to be attached to a provider
without holding an access count.

But lacking an access count, there are obviously things you cannot do to that
provider.


-- 
Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk@FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe    
Never attribute to malice what can adequately be explained by incompetence.



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