Difference between setting geli(8) key when attached or detached

Pawel Jakub Dawidek pjd at FreeBSD.org
Fri Jun 1 04:26:41 UTC 2007


On Fri, Jun 01, 2007 at 12:44:27AM +0200, Jeremie Le Hen wrote:
> Hi Pawel,
> 
> I dare to contact you because I'm studying GELI's code and I found
> a piece of code I'm not sure to understand, although I've read phk's
> GEOM tutorial thoroughly.
> 
> >From what I've undertood (please, correct me if I'm wrong), a
> "spoiled" event is ``posted when a provider gets a non-zero access
> count.  All attached providers, except the guilty party, are
> notified.''

s/non-zero access count/non-zero write access count/

Here is the thing. When your class makes decisions based on provider's
on-disk metadata, you want to receive spoil event and self-destruct,
because open for write means that someone may modify your metadata.
Then, on last write close, taste event is send and your class can read
eventually modified metadata once again.

> geli(8)'s "setkey" command uses two different code paths, depending
> on whether the provider is attached or not.  If is it attached,
> it seems to use the GEOM kernel part to update the key while
> if it is detached it writes it directly from userland.
> 
> My thought is that the provider being modified is not notified
> by the GEOM framework.  Am I right?

GELI doesn't do autoconfiguration. The only place when GELI uses taste
event is before root file system is mounted, so it can ask for a
passphrase when needed.

Not sure if this answers your question...

-- 
Pawel Jakub Dawidek                       http://www.wheel.pl
pjd at FreeBSD.org                           http://www.FreeBSD.org
FreeBSD committer                         Am I Evil? Yes, I Am!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-geom/attachments/20070601/0fe46ac1/attachment.pgp


More information about the freebsd-geom mailing list