Page MenuHomeFreeBSD

loader.efi: only fetch zfs pool guid for the actual boot device

Authored by tsoome on Apr 11 2017, 12:19 PM.



With the zfs proble cleanup, the mistake did slip in the probe code;
instead of reading the pool GUID for the actual boot device (partition),
we read GUID for first found pool from the boot disk.

This will break the case when there are both zfs pool and ufs on the boot
disk, and the ufs is used for boot, not zfs.

Diff Detail

rS FreeBSD src repository
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

tsoome created this revision.Apr 11 2017, 12:19 PM
smh requested changes to this revision.Apr 11 2017, 12:34 PM
smh added a subscriber: smh.
smh added inline comments.
827 ↗(On Diff #27345)

Comment needs updating

836 ↗(On Diff #27345)

This logic is confusing why not just do:

if (pd->pd_handle == boot_dev)
      (void) zfs_probe_dev(devname, &pool_guid);
      (void) zfs_probe_dev(devname, NULL);

Also why not merge the two sets of loops?

This revision now requires changes to proceed.Apr 11 2017, 12:34 PM
andrew added a subscriber: andrew.Apr 11 2017, 1:27 PM

This works for me on a ThunderX with UFS root & ZFS.

tsoome updated this revision to Diff 27348.Apr 11 2017, 1:57 PM
tsoome edited edge metadata.

We do not really need double loop and pointer game.

tsoome marked 2 inline comments as done.Apr 11 2017, 1:58 PM
tsoome added inline comments.
836 ↗(On Diff #27345)

yes, no need for them. nuked.

tsoome marked an inline comment as done.Apr 11 2017, 1:59 PM
smh accepted this revision.Apr 11 2017, 2:03 PM

LGM, much cleaner than it was.

This revision is now accepted and ready to land.Apr 11 2017, 2:03 PM
This revision was automatically updated to reflect the committed changes.