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
F157231954: D26658.id78134.diff
Tue, May 19, 1:12 PM
Unknown Object (File)
Sat, May 16, 6:39 PM
Unknown Object (File)
Sun, May 10, 4:41 AM
Unknown Object (File)
Sun, May 10, 4:11 AM
Unknown Object (File)
Sat, May 9, 9:46 PM
Unknown Object (File)
Wed, Apr 29, 5:27 AM
Unknown Object (File)
Tue, Apr 28, 11:42 PM
Unknown Object (File)
Tue, Apr 28, 2:17 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.