From: Bart Van Assche Date: Wed, 4 Apr 2018 20:45:54 +0000 (-0700) Subject: engines/sg: Make I/O error messages more informative X-Git-Tag: fio-3.6~18^2~5 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=c9aeb7971b454775523dd5a08a634d76426b7452;ds=sidebyside engines/sg: Make I/O error messages more informative Ensure that if an I/O error is encountered that not only the error number but also a textual error message and the engine name are reported. Without this patch, SG error messages look like this: fio: pid=12803, err=5/ With this patch applied SG I/O error messages change into: fio: pid=12803, err=5/file:engines/sg.c:290, func=fio_sgio_doio, error=Input/output error Signed-off-by: Bart Van Assche --- diff --git a/engines/sg.c b/engines/sg.c index 72eed8b3..c2c0de39 100644 --- a/engines/sg.c +++ b/engines/sg.c @@ -287,11 +287,11 @@ static int fio_sgio_doio(struct thread_data *td, struct io_u *io_u, int do_sync) if (f->filetype == FIO_TYPE_BLOCK) { ret = fio_sgio_ioctl_doio(td, f, io_u); - td->error = io_u->error; + td_verror(td, io_u->error, __func__); } else { ret = fio_sgio_rw_doio(f, io_u, do_sync); if (do_sync) - td->error = io_u->error; + td_verror(td, io_u->error, __func__); } return ret;