Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 15 Mar 2005 09:10:38 +0100
From:      Pawel Jakub Dawidek <pjd@FreeBSD.org>
To:        freebsd-geom@freebsd.org
Subject:   GBDE and write_sector-shutdown-write_keys race.
Message-ID:  <20050315081038.GD9291@darkness.comp.waw.pl>

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

--WIarmzxAAJZoYT0o
Content-Type: text/plain; charset=iso-8859-2
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Hi.

If you, guys, remember this issue, I think I found a way to fix it.

Now, there can be a race like this:

	write sector data
	               <- power failure here
	write new sector keys

My idea is to not use entire sector for 128bit AES keys, instead, we can
save keys and sector mapping there (I'll explain it later).
For every zone we need to leave one spare sector.

If we have a write request algorithm is as follows:
1. Generate new key for this sector.
2. Write sector data into spare sector in a zone.
3. Write sector key and update mapping.

Point number three is operates on the same sector, so we can assume its
atomic.

The sectors mapping looks like this (let's assume we have 4 sectors in zone
and 1 spare sector):
Real		In-zone
sector		sector
number		number
1	->	1
2	->	2
3	->	3
4	->	4
(sector 5 is the spare sector)
After writting to sector 3 we have:
1	->	1
2	->	2
3	->	5
4	->	4
(sector 3 is now the spare sector)
After writing to sector 1 we have:
1	->	3
2	->	2
3	->	5
4	->	4
(sector 1 is now the spare sector)

This thing will decrease number of sectors in zone, because we need to
put mappings there, so we are losing some space. We also need a per-zone
spare sector, so it reduces space again, but it gives as reliability.

--=20
Pawel Jakub Dawidek                       http://www.wheel.pl
pjd@FreeBSD.org                           http://www.FreeBSD.org
FreeBSD committer                         Am I Evil? Yes, I Am!

--WIarmzxAAJZoYT0o
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (FreeBSD)

iD8DBQFCNph+ForvXbEpPzQRAvKBAJ43poAUMDd1pCC2RHZmTcSvYyszMACdFx2/
J+JaEkQlAayHFx7ovCq/uz8=
=pecs
-----END PGP SIGNATURE-----

--WIarmzxAAJZoYT0o--



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