Label question...why does ufs label vanish on mount?

Andrey V. Elsukov bu7cher at yandex.ru
Wed Oct 13 08:55:04 UTC 2010


On 13.10.2010 10:29, Stefan Bethke wrote:
>> When you are opening provider for writing (i.e. mount FS) GEOM(4)
>> initiates SPOILING and all consumers that are attached to this provider
>> except one will self-destroyed. When you are closing provider GEOM(4)
>> initiates TASTING and consumers can return back. Look at man 4 geom
>> for details.
> 
> That explains the mechanism, but not the rationale.  Or is it just an 
> unintended consequence?  And how is da2p1 different from ufs/mylabel?
> (Mount da2p1 and ufs/mylabel is removed, but not the other way around.)

This is by design. Any provider's entries in /dev are created by GEOM_DEV
class. GEOM_PART serves partition tables. GEOM_PART_GPT as part of GEOM_PART
serves GPT. GEOM_PART creates new provider for each entry in GPT.

For example:
da2 has GPT. da2p1 - first entry in GPT. GEOM_PART creates da2p1 provider
and GEOM initiate tasting. GEOM_DEV creates new consumer for da2p1 and
/dev/da2p1 entry in devfs. At the same time GEOM_LABEL checks this provider
and if it found "labels" it creates new consumer and new provider with name
ufs/mylabel via slicer interface. After creating new provider GEOM initiate
tasting again. And GEOM_DEV creates new consumer and /dev/ufs/mylabel entry.

So, now we have two providers through we can get access to one device.
But ufs/mylabel's is on top of da2p1. When we do first open one of them for
writing GEOM initiate spoiling for protecting from stale metadata. When we
do open da2p1 then GEOM_LABEL receives spoil event and destroys own provider.

If I'm wrong Pawel can correct me.

-- 
WBR, Andrey V. Elsukov

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
Url : http://lists.freebsd.org/pipermail/freebsd-stable/attachments/20101013/3be2ee00/signature.pgp


More information about the freebsd-stable mailing list