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)
Fri, Dec 20, 2:42 PM
Unknown Object (File)
Oct 13 2024, 1:55 AM
Unknown Object (File)
Oct 13 2024, 1:55 AM
Unknown Object (File)
Oct 13 2024, 1:55 AM
Unknown Object (File)
Oct 13 2024, 1:55 AM
Unknown Object (File)
Oct 13 2024, 1:25 AM
Unknown Object (File)
Oct 4 2024, 11:59 PM
Unknown Object (File)
Sep 24 2024, 5:58 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

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

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.