Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 13 Oct 2010 12:54:56 +0400
From:      "Andrey V. Elsukov" <bu7cher@yandex.ru>
To:        Stefan Bethke <stb@lassitu.de>
Cc:        stable@freebsd.org
Subject:   Re: Label question...why does ufs label vanish on mount?
Message-ID:  <4CB573E0.1030104@yandex.ru>
In-Reply-To: <B6AAC89E-5651-4B4B-B770-11443A7BCC22@lassitu.de>
References:  <20101012185100.5AA661CC3E@ptavv.es.net>	<4CB53BF7.1020408@yandex.ru> <B6AAC89E-5651-4B4B-B770-11443A7BCC22@lassitu.de>

next in thread | previous in thread | raw e-mail | index | archive | help

[-- Attachment #1 --]
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


[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)

iQEcBAEBAgAGBQJMtXPjAAoJEAHF6gQQyKF6CY0H/0N2S7hsxzIdyg8uSKDrWpQ+
laAFM8AOhVArtNv0/KfPQnNm670rEeNZYfZhwNnutblhvBnNR3J/ZctgwE5mrmx6
6xXwKKz5Md/FCeZolgFAy74LL+9CFiqws6tfTffUqXpuEY5o0OZb0cnxeaN1xLQS
G/cLQ1V2oHufOm1Fd1dIQVzJ0iHkNbLXT1TgiWzPHTrkWj1w3Ke2azRhQFxxLb/9
6FUUtIbkRcJH/4Elk/TJ3aMUfQ1hmPIx6Ih0+Gfhs9gThK860f4nSneZxD4V9Whr
6l/0Q0ZBljru0MJ+/eSmPbATkeB6YLmBiDuDV79icUiNF8RXLb0XTaRcCypXzO4=
=j7M0
-----END PGP SIGNATURE-----

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