X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=ioengines.c;h=5a2d6b90fb0c6d73d45d0b6c5ce5307f505691d2;hp=879c5f1c1f438a20a5116bec93968fc0d4e0642f;hb=b2bd2bd96a09540b3add0ec74db2cdb1c145ca33;hpb=f85ac25a7d5c9d5ba4d5c73363a6a2a461a9b013;ds=sidebyside diff --git a/ioengines.c b/ioengines.c index 879c5f1c..5a2d6b90 100644 --- a/ioengines.c +++ b/ioengines.c @@ -168,10 +168,14 @@ int td_io_prep(struct thread_data *td, struct io_u *io_u) dprint_io_u(io_u, "prep"); fio_ro_check(td, io_u); + lock_file(td, io_u->file); + if (td->io_ops->prep) { int ret = td->io_ops->prep(td, io_u); dprint(FD_IO, "->prep(%p)=%d\n", io_u, ret); + if (ret) + unlock_file(io_u->file); return ret; } @@ -228,6 +232,8 @@ int td_io_queue(struct thread_data *td, struct io_u *io_u) ret = td->io_ops->queue(td, io_u); + unlock_file(io_u->file); + if (ret != FIO_Q_BUSY) io_u_mark_depth(td, io_u);