Page MenuHomeFreeBSD

loader zfs should check for MOS features
ClosedPublic

Authored by tsoome on Jun 16 2016, 6:32 AM.
Tags
None
Referenced Files
Unknown Object (File)
Feb 1 2024, 7:37 AM
Unknown Object (File)
Jan 29 2024, 1:13 PM
Unknown Object (File)
Jan 10 2024, 8:27 PM
Unknown Object (File)
Jan 4 2024, 8:18 AM
Unknown Object (File)
Dec 20 2023, 6:10 AM
Unknown Object (File)
Aug 24 2023, 2:58 PM
Unknown Object (File)
Aug 4 2023, 7:09 PM
Unknown Object (File)
Aug 4 2023, 7:07 PM

Details

Summary

Current zfs reader in loader does only check label features, which is not enough
to ensure the pool is really usable for booting. As new features are being
implemented and not yet implemented in boot loader, the zfs code should
be verbose about unsupported features and not fail with misleading error
messages.

Test Plan

Tested with illumos pool which has skein active - loader does detect this
and exclude this pool from device list (lsdev).

Diff Detail

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

Event Timeline

tsoome retitled this revision from to loader zfs should check for MOS features.
tsoome updated this object.
tsoome edited the test plan for this revision. (Show Details)
delphij requested changes to this revision.Jun 17 2016, 5:30 AM
delphij added a reviewer: delphij.

Request for a few changes.

sys/boot/zfs/libzfs.h
68 ↗(On Diff #17617)

Second parameter should have __unused too.

sys/boot/zfs/zfsimpl.c
1580 ↗(On Diff #17617)

Please use __unused and sys/cdefs.h.

1875 ↗(On Diff #17617)

name shouldn't be necessary here.

2029 ↗(On Diff #17617)

no space after strcmp (see style(9)).

2056 ↗(On Diff #17617)

Please remove this.

2088 ↗(On Diff #17617)

I think this would be too verbose (only useful for debugging)? i.e. why a system administrator care if the data pool is not supported by the boot block?

This revision now requires changes to proceed.Jun 17 2016, 5:30 AM
tsoome edited edge metadata.
tsoome marked 5 inline comments as done.

Fixes as suggested by delphij.
svn update.

sys/boot/zfs/zfsimpl.c
2088 ↗(On Diff #17617)

If someone like me is using different boot pools in same system, this is useful feedback, so I don't have to guess why some of the pools are not visible. Or even worse, if my only boot pool is rendered unusable for booting, it would be good to get some verbose message. That was the reason why I did insert this printf; also in feature check callback there is no access to pool name, otherwise I would have used it in check_feature().

allanjude added inline comments.
sys/boot/zfs/zfsimpl.c
2088 ↗(On Diff #17617)

Can we check for the 'bootfs' property? If a pool doesn't have that set, no one is expecting to boot from it, but if it does have it, they should get an error.

sys/boot/zfs/zfsimpl.c
2088 ↗(On Diff #17617)

Thats one possible option, but not entirely correct as well, because bootfs is just an hint for boot loader to support automatic load and boot, but human operator can still just set currdev and go;)

TBH, I wouldn't really worry too much about the message itself, because a) beastie will hide it (poor excuse;), and well, on more serious note, we can get full feature support for loader, if we really want to - in fact, the illumos port I'm working on, already does have *full* current feature set supported - gzip, sha512, edonr, skein. Technically its no problem to support them, there are some other decisions to be made, however.

tsoome edited edge metadata.

Missing braces for if statement.

delphij edited edge metadata.
This revision is now accepted and ready to land.Jun 26 2016, 3:25 AM
mav edited edge metadata.

Looks good for me.

@tsoome_me.com, do you have a commit bit? Or do you depend on a committer to commit this change?

tsoome edited edge metadata.

Updated to revision 302853.

This revision now requires review to proceed.Jul 14 2016, 6:15 PM
In D6857#149962, @avg wrote:

@tsoome_me.com, do you have a commit bit? Or do you depend on a committer to commit this change?

yea, I'm depending on a committer:D

tsoome edited edge metadata.

Updated to revision 303561.

Not sure if this is intentional, but if I have a dataset (not the one that I boot from) that has skein as the checksum, so the feature is 'active', this change makes booting fail "ZFS: unsupported feature: org.illumos:skein"

However, before this patch, it booted fine, as the feature was not active on the root dataset, only a secondary dataset that is not used during boot.

allanjude added a reviewer: allanjude.

This works as expected.

While this will fail to boot a pool that has activated a new unsupported feature, the zfs userland tools prevent a user from activating those features if the bootfs zpool property is set, so a user is protected from shooting off their own foot.

This revision is now accepted and ready to land.Aug 1 2016, 7:28 PM
This revision was automatically updated to reflect the committed changes.