Page MenuHomeFreeBSD

loader: zfs reader should check all labels
ClosedPublic

Authored by tsoome on Mar 30 2017, 3:39 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Mar 29, 12:06 PM
Unknown Object (File)
Thu, Mar 28, 2:33 PM
Unknown Object (File)
Feb 13 2024, 4:28 AM
Unknown Object (File)
Dec 20 2023, 11:33 AM
Unknown Object (File)
Dec 20 2023, 6:47 AM
Unknown Object (File)
Oct 27 2023, 3:17 PM
Unknown Object (File)
Sep 5 2023, 9:19 PM
Unknown Object (File)
Aug 26 2023, 2:26 PM
Subscribers

Details

Summary

The current zfs reader is only checking first label from each device, however,
we do have 4 labels on device and we should check all 4 to be protected
against disk failures and incomplete label updates.

The difficulty is about the fact that 2 label copies are in front of the
pool data, and 2 are at the end, which means, we have to know the size of
the pool data area.

Since we have now the mechanism from common/disk.c to use the partition
information, it does help us in this task; however, there are still some
corner cases.

Namely, if the pool is created without partition, directly on the disk,
and firmware will give us the wrong size for the disk, we only can check
the first two label copies.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

even just reading the 2nd label is a big improvement. Thank you.

Have you tested this by say clobbering the first label?

even just reading the 2nd label is a big improvement. Thank you.

Have you tested this by say clobbering the first label?

no, but I did had printouts for label and UB instances while developing - so i had chance to see it is doing the correct thing afterall:D also there is parallel review up at illumos side: https://www.illumos.org/rb/r/250/

altho, the zfsboot.c details are a bit different there.

This revision is now accepted and ready to land.Apr 6 2017, 3:04 PM
This revision was automatically updated to reflect the committed changes.