aio: Fix a test and set race in aio_biowakeup.
Use atomic_fetchadd in place of separate atomic_subtract / atomic_load. Reviewed by: markj Sponsored by: HPE TidalScale Differential Revision: https://reviews.freebsd.org/D38559
This commit is contained in:
parent
96871af013
commit
40734fc57e
@ -2493,10 +2493,9 @@ aio_biowakeup(struct bio *bp)
|
||||
atomic_add_int(&job->outblock, nblks);
|
||||
else
|
||||
atomic_add_int(&job->inblock, nblks);
|
||||
atomic_subtract_int(&job->nbio, 1);
|
||||
|
||||
|
||||
if (atomic_load_int(&job->nbio) == 0) {
|
||||
if (atomic_fetchadd_int(&job->nbio, -1) == 1) {
|
||||
if (atomic_load_int(&job->error))
|
||||
aio_complete(job, -1, job->error);
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user