HomeFreeBSD

aio: Fix more synchronization issues in aio_biowakeup.

Description

aio: Fix more synchronization issues in aio_biowakeup.

  • 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)
Reviewed by: mjg, markj
Differential Revision: https://reviews.freebsd.org/D38611

Details

Provenance
jhbAuthored on Feb 15 2023, 9:32 PM
Reviewer
mjg
Differential Revision
D38611: aio: Fix more synchronization issues in aio_biowakeup.
Parents
rG059320b8c8de: nproc: denote an incompatiblity with Linux
Branches
Unknown
Tags
Unknown