Page MenuHomeFreeBSD

Make g_attach() return ENXIO for orphaned providers.
ClosedPublic

Authored by trasz on Oct 4 2020, 3:17 PM.
Tags
None
Referenced Files
Unknown Object (File)
Feb 23 2024, 12:08 PM
Unknown Object (File)
Dec 23 2023, 3:59 PM
Unknown Object (File)
Dec 23 2023, 1:09 AM
Unknown Object (File)
Dec 11 2023, 5:54 AM
Unknown Object (File)
Dec 5 2023, 6:25 PM
Unknown Object (File)
Dec 3 2023, 7:40 PM
Unknown Object (File)
Dec 3 2023, 7:40 PM
Unknown Object (File)
Dec 3 2023, 7:40 PM

Details

Summary

Make g_attach() return ENXIO for orphaned providers.

This patch is somewhat incomplete - it doesn't update all the GEOM
classes to properly handle g_attach() errors. I'd like some feedback
before I go and do that.

Diff Detail

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 33975
Build 31168: arc lint + arc unit

Event Timeline

trasz requested review of this revision.Oct 4 2020, 3:17 PM
trasz created this revision.

It worries me that this introduces additional failure point where some classes do not check for it. I would investigate whether the situation of attachment to withered provider is actually possible and/or may be handled otherwise. I agree that there should be a problem with orohan() not being called for consumers attached in that moment, just not sure from what side it should better be addressed without deeper look.

Well, the way it came to be is it fixed an actual bug found by NetApp. It's quite hard to reproduce, but given all the places where we happily drop the topology lock, I don't see why it wouldn't happen.

Also, note that I'll update this diff to fix all the calls to g_attach() in the tree, if the approach above makes sense.

Add missing error checking.

One class left to do is graid(4); I'm not sure how to handle
the errors there. Add 'if (cp->provider != NULL)' before g_detach()
perhaps?

I don't suppose you have a good test case that triggers the underling issue, do you?

This revision is now accepted and ready to land.Oct 12 2020, 6:00 PM
In D26658#596394, @imp wrote:

I don't suppose you have a good test case that triggers the underling issue, do you?

No, sadly I don't.