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)
Sep 26 2024, 1:02 AM
Unknown Object (File)
Sep 21 2024, 8:59 PM
Unknown Object (File)
Sep 21 2024, 7:42 PM
Unknown Object (File)
Sep 21 2024, 3:02 AM
Unknown Object (File)
Sep 20 2024, 4:52 PM
Unknown Object (File)
Sep 19 2024, 7:24 AM
Unknown Object (File)
Sep 18 2024, 11:33 AM
Unknown Object (File)
Sep 17 2024, 6:13 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 45334
Build 42222: 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
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