Page MenuHomeFreeBSD

g_vfs_done: Report when we switch on ENXIO conversion
ClosedPublic

Authored by imp on Apr 23 2022, 9:07 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Sep 8, 1:59 PM
Unknown Object (File)
Sun, Sep 8, 7:56 AM
Unknown Object (File)
Sat, Sep 7, 9:27 PM
Unknown Object (File)
Sat, Sep 7, 3:44 PM
Unknown Object (File)
Thu, Sep 5, 3:21 PM
Unknown Object (File)
Thu, Sep 5, 10:48 AM
Unknown Object (File)
Wed, Sep 4, 7:34 PM
Unknown Object (File)
Thu, Aug 29, 6:49 PM
Subscribers
None

Details

Summary

On the false -> true transition of sc_enxio_active, report that we're
doing this. This is a rare, but interesting, evevnt.Convert to using
atomics to set/load this field to prevent a rare race:

In CAM, one thread calls biodone with ENXIO as the return code and
another thread can invalidate the device (causing the queued
requests to complete with ENXIO). These two threads could race and
could lose the printf. Since this is an error path that's
infrequent, the extra atomic traffic won't slow down the slow path.

Sponsored by: Netflix

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

imp requested review of this revision.Apr 23 2022, 9:07 PM
imp created this revision.
kib added inline comments.
sys/geom/geom_vfs.c
146

Same note about the race.

This revision is now accepted and ready to land.Apr 23 2022, 10:22 PM
This revision now requires review to proceed.Apr 24 2022, 12:08 AM
imp added inline comments.
sys/geom/geom_vfs.c
146

fixed.

sys/geom/geom_vfs.c
191

Not sure if we tag these with atomic_load_int() or not.
In this case, it doesn't matter: if we win the race, we'll have one more request go down and back up and then fail. If we lose the race, we'll fail it here.

spell cmpset function right <blush>

This revision is now accepted and ready to land.Apr 24 2022, 1:31 PM