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 34956e9..5ea1a2c 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);