geom orphan question

Poul-Henning Kamp phk at phk.freebsd.dk
Wed Oct 19 11:03:34 PDT 2005


In message <20051019175310.GC76081 at web.djw.hu>, Szalai Andras writes:

>I have spent few hours trying to understand geom. The I/O
>path is more or less okay, but I have problems with
>the orphanization procedure.
>
>For example, if you look into g_concat.c there is a 
>g_concat_orphan function that calls g_concat_remove_disk.
>In this function, gconcat
>
>1) orphans its own provider (g_orphan_provider),
>2) reset access counts (g_access), 
>3) detach consumer from the lower layer provider,
>4) destroy the consumer.
>
>In order to detach the consumer (step 3) you have to be sure 
>that there are no active requests (bios) between the consumer and
>provider. My question is how can I guarantee that there are 
>no active bios when I call g_detach?

There are counters in consumers and providers which can tell
you that.

The above code seems to play fast and loose with that aspect.

-- 
Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk at 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.


More information about the freebsd-geom mailing list