Page MenuHomeFreeBSD

geom_disk: Export attachment if present in XML config
AcceptedPublic

Authored by jrtc27 on Aug 28 2024, 11:11 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Oct 7, 12:17 AM
Unknown Object (File)
Fri, Oct 4, 12:49 AM
Unknown Object (File)
Wed, Oct 2, 9:42 PM
Unknown Object (File)
Wed, Oct 2, 7:21 PM
Unknown Object (File)
Sep 26 2024, 6:51 PM
Unknown Object (File)
Sep 12 2024, 6:36 PM
Unknown Object (File)
Sep 9 2024, 11:19 PM
Unknown Object (File)
Sep 1 2024, 8:22 AM
Subscribers
None

Details

Reviewers
imp
mav
Summary

This allows geom(8) to display the attachment such that an unprivileged
user can link up geom disks with their newbus counterparts, just as
diskinfo(8) can already do today with a device ioctl.

MFC after: 1 month

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 59219
Build 56106: arc lint + arc unit

Event Timeline

jrtc27 created this revision.
sys/geom/geom_disk.c
638

Hm, we don't actually need this to be overridable, it's always going to be a static thing drivers can just set to the right value. Will simplify by always using d_attachment, which is also simplifying for another change I'd like to make.

Don't bother with d_getattr call

It seems BIO_GETATTR allows GEOM::attachment override. Though I am not saying it is very useful.

This revision is now accepted and ready to land.Aug 29 2024, 1:20 AM
In D46468#1059227, @mav wrote:

It seems BIO_GETATTR allows GEOM::attachment override. Though I am not saying it is very useful.

I think it's more to allow BIO_GETATTRY as a way for userspace to query it. GEOM::fw{head,sector}s are similarly handled like that for BIO_GETATTR yet we don't consider d_getattr overriding them. GEOM::ident is a bit of a special case to allow it to be dynamic even though there's a d_ident (as per your rGccba710262443cf4cf2350f173750cf51572d3b9).

There's a lot of other attributes that would be useful to export... but this is a good start.

I lean towards direct access here because geom_disk is allowed to know about itself...