Page MenuHomeFreeBSD

aio: Fix more synchronization issues in aio_biowakeup.
ClosedPublic

Authored by jhb on Feb 15 2023, 7:02 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Nov 14, 8:43 PM
Unknown Object (File)
Sun, Oct 20, 4:40 PM
Unknown Object (File)
Oct 2 2024, 3:57 AM
Unknown Object (File)
Sep 30 2024, 8:04 PM
Unknown Object (File)
Sep 29 2024, 3:23 AM
Unknown Object (File)
Sep 29 2024, 1:36 AM
Unknown Object (File)
Sep 27 2024, 4:24 PM
Unknown Object (File)
Sep 26 2024, 8:11 PM
Subscribers

Details

Summary
  • Use atomic_store to set job->error. atomic_set does an or operation, not assignment.
  • Use refcount_* to manage job->nbio.

    This ensures proper memory barriers are present so that the last bio won't see a possibly stale value of job->error.
  • Don't re-read job->error after reading it via atomic_load.

Reported by: markj (1)

Diff Detail

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

Event Timeline

jhb requested review of this revision.Feb 15 2023, 7:02 PM

hrmpf

so turns out atomic_set *is* like atomic_store on linux....

mumbling ensues

that is just a side note though

another one is that the volatile u_int stuff for refcounts needs to die, but again not a blocker

This revision is now accepted and ready to land.Feb 15 2023, 7:06 PM