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
F94572558: D35037.diff
Tue, Sep 17, 6:13 PM
F94521662: D35037.diff
Tue, Sep 17, 2:36 PM
Unknown Object (File)
Mon, Sep 16, 4:28 PM
Unknown Object (File)
Sun, Sep 15, 10:09 PM
Unknown Object (File)
Sun, Sep 15, 2:03 AM
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
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
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 45330
Build 42218: arc lint + arc unit

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
147

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
147

fixed.

sys/geom/geom_vfs.c
193

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