Page MenuHomeFreeBSD

efivar: Really look for labels for the provider with right efimedia
ClosedPublic

Authored by imp on Feb 15 2023, 9:14 PM.
Tags
None
Referenced Files
Unknown Object (File)
Oct 29 2024, 1:00 PM
Unknown Object (File)
Oct 8 2024, 3:25 PM
Unknown Object (File)
Oct 8 2024, 3:25 PM
Unknown Object (File)
Oct 8 2024, 3:25 PM
Unknown Object (File)
Oct 8 2024, 3:25 PM
Unknown Object (File)
Oct 8 2024, 3:25 PM
Unknown Object (File)
Oct 8 2024, 3:25 PM
Unknown Object (File)
Oct 8 2024, 2:55 PM
Subscribers
None

Details

Summary

The prior code mistakently thought that the g_consumer that hung off the
provider we found were the right thing to use to find all the glabel
aliases for this node. However, the only way to find that is to iterate
through all the geoms that belong to the glabel geom class, looking for
those geoms with the same name as the provider with the right efimedia.
Do this in a way that caches glabel class, and allows for it to be
absent. Tighten the filter for mounted filesystems to only look
for the ones that are mounted on /dev/.. since the rest of the code
assumes that.

Sponsored by: Netflix

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 49821
Build 46712: arc lint + arc unit

Event Timeline

imp requested review of this revision.Feb 15 2023, 9:14 PM
imp created this revision.

This fixes the path returned in abspath. However, it doesn't fix what's returned in dev. You can demonstrate by doing something like efivar -Op 8be4df61-93ca-11d2-aa0d-00e098032b8c-Boot0014. That will print the partition name instead of the label name.

lib/libefivar/efivar-dp-xlate.c
251
This revision now requires changes to proceed.Feb 15 2023, 10:04 PM

fix the answer on more cases.

This fixes the path returned in abspath. However, it doesn't fix what's returned in dev. You can demonstrate by doing something like efivar -Op 8be4df61-93ca-11d2-aa0d-00e098032b8c-Boot0014. That will print the partition name instead of the label name.

Well, that depends on what's mounted. And it is a correct answer, but I'll grant it's not the most correct answer.
If nothing's mounted, it's right, for example.

We update *dev too early. I've updated the diff to take that into account.

imp marked an inline comment as done.Feb 15 2023, 10:47 PM

Updated, please let me know if this works for your tests... It's passing all I can throw at it.

Also, yes, this tells me I need to bite the bullet and write regression tests in atf

In D38619#878854, @imp wrote:

Also, yes, this tells me I need to bite the bullet and write regression tests in atf

The hard part of *THAT* is generating UUIDs that are the same every run... which is why I've not done it yet...

This revision is now accepted and ready to land.Feb 15 2023, 11:16 PM
This revision now requires review to proceed.Feb 16 2023, 12:40 AM

I've tested your patch stack and it works for my use case.

This revision is now accepted and ready to land.Feb 16 2023, 9:11 AM

I've tested your patch stack and it works for my use case.

Thanks for testing and for the review.