Fix fill_device with queue depth higher than 1
authorSteven Lang <tirea@google.com>
Mon, 13 Jun 2011 07:47:36 +0000 (09:47 +0200)
committerJens Axboe <jaxboe@fusionio.com>
Mon, 13 Jun 2011 07:47:36 +0000 (09:47 +0200)
I found an interesting combination of using fill_device when the
iodepth is greater than 1.  All outstanding IO causes an ENOSPC error,
but only the first is treated specially.  The remainder come through
and cause an error exit condition when the IO queue is being cleared.
So it is impossible to use deep IO with fill device.

This patch should fix the issue.

Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
fio.c

diff --git a/fio.c b/fio.c
index 34956e9f101ead149ee430d3b64b6c6ba52304d2..5ea1a2c32fc3d44edda83d910c8d11f8015cc1c9 100644 (file)
--- a/fio.c
+++ b/fio.c
@@ -760,8 +760,11 @@ sync_done:
                struct fio_file *f;
 
                i = td->cur_depth;
-               if (i)
+               if (i) {
                        ret = io_u_queued_complete(td, i, NULL);
+                       if (td->o.fill_device && td->error == ENOSPC)
+                               td->error = 0;
+               }
 
                if (should_fsync(td) && td->o.end_fsync) {
                        td_set_runstate(td, TD_FSYNCING);