X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=ioengines.c;h=d71e372048112e19010c1dd494a7a4b2872eb5fa;hp=234f8edd13251ab07e7f7b431d3d90279c4c9b9a;hb=d1415111eebe7a95d8de1af1ec61e80f9d534552;hpb=bcd5abfa9f230bbe4365dad1289fdea1f5509f74 diff --git a/ioengines.c b/ioengines.c index 234f8edd..d71e3720 100644 --- a/ioengines.c +++ b/ioengines.c @@ -236,7 +236,7 @@ int td_io_getevents(struct thread_data *td, unsigned int min, unsigned int max, out: if (r >= 0) { /* - * Reflect that our submitted requests were retrieved with + * Reflect that our submitted requests were retrieved with * whatever OS async calls are in the underlying engine. */ td->io_u_in_flight -= r; @@ -287,6 +287,13 @@ int td_io_queue(struct thread_data *td, struct io_u *io_u) unlock_file(td, io_u->file); + /* + * If an error was seen and the io engine didn't propagate it + * back to 'td', do so. + */ + if (io_u->error && !td->error) + td_verror(td, io_u->error, "td_io_queue"); + /* * Add warning for O_DIRECT so that users have an easier time * spotting potentially bad alignment. If this triggers for the first @@ -366,14 +373,14 @@ int td_io_commit(struct thread_data *td) if (!td->cur_depth || !td->io_u_queued) return 0; - io_u_mark_depth(td, td->io_u_queued); + io_u_mark_depth(td, td->io_u_queued); if (td->io_ops->commit) { ret = td->io_ops->commit(td); if (ret) td_verror(td, -ret, "io commit"); } - + /* * Reflect that events were submitted as async IO requests. */ @@ -475,7 +482,9 @@ int td_io_close_file(struct thread_data *td, struct fio_file *f) fio_file_set_closing(f); disk_util_dec(f->du); - unlock_file_all(td, f); + + if (td->o.file_lock_mode != FILE_LOCK_NONE) + unlock_file_all(td, f); return put_file(td, f); } @@ -538,7 +547,7 @@ int do_io_u_trim(struct thread_data *td, struct io_u *io_u) ret = os_trim(f->fd, io_u->offset, io_u->xfer_buflen); if (!ret) - return io_u->xfer_buflen;; + return io_u->xfer_buflen; io_u->error = ret; return 0;