[PATCH] backend: clear IO_U_F_FLIGHT flag in zero byte read path

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



When read io_u completes with zero byte read, it sets EIO as the error
and put the io_u. However, it does not clear the IO_U_F_FLIGHT flag.
When fio runs with --ignore_error=EIO option, the io_u with the flag is
reused for next I/O and causes an assertion failure:

  fio: ioengines.c:335: td_io_queue: Assertion `(io_u->flags & IO_U_F_FLIGHT) == 0' failed.

The failure is observed with blktests test case block/011 which runs fio
with the --ignore_error=EIO option [1].

  [1] https://github.com/osandov/blktests/issues/29

Fix this by calling clear_io_u() instead of put_io_u() in the zero byte
read path. clear_io_u() clears the IO_U_F_FLIGHT flag then calls
put_io_u().

Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@xxxxxxx>
---
 backend.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/backend.c b/backend.c
index b06a11a5..cb5844db 100644
--- a/backend.c
+++ b/backend.c
@@ -466,7 +466,7 @@ int io_queue_event(struct thread_data *td, struct io_u *io_u, int *ret,
 				if (!from_verify)
 					unlog_io_piece(td, io_u);
 				td_verror(td, EIO, "full resid");
-				put_io_u(td, io_u);
+				clear_io_u(td, io_u);
 				break;
 			}
 
-- 
2.40.1




[Index of Archives]     [Linux Kernel]     [Linux SCSI]     [Linux IDE]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux