Fix issue with fill_device=1 and continue_on_error
authorRadha Ramachandran <radha@google.com>
Thu, 2 Jul 2009 06:30:49 +0000 (08:30 +0200)
committerJens Axboe <jens.axboe@oracle.com>
Thu, 2 Jul 2009 06:30:49 +0000 (08:30 +0200)
I added a change so when both the continue_on_error and fill_device
option is on, when it hits ENOSPC issue the code ignores the error.

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
fio.c

diff --git a/fio.c b/fio.c
index 63d9a1b7ab434ca4eba416ab2fe71bbc9e71385a..f6ed89f2cc7fc78644ded12a3090e3083754d4a8 100644 (file)
--- a/fio.c
+++ b/fio.c
@@ -388,21 +388,29 @@ static int break_on_this_error(struct thread_data *td, int *retptr)
                else
                        err = td->error;
 
                else
                        err = td->error;
 
-               update_error_count(td, err);
-
                if (td_non_fatal_error(err)) {
                        /*
                         * Continue with the I/Os in case of
                         * a non fatal error.
                         */
                if (td_non_fatal_error(err)) {
                        /*
                         * Continue with the I/Os in case of
                         * a non fatal error.
                         */
+                       update_error_count(td, err);
                        td_clear_error(td);
                        *retptr = 0;
                        return 0;
                        td_clear_error(td);
                        *retptr = 0;
                        return 0;
+               } else if (td->o.fill_device && err == ENOSPC) {
+                       /*
+                        * We expect to hit this error if
+                        * fill_device option is set.
+                        */
+                       td_clear_error(td);
+                       td->terminate = 1;
+                       return 1;
                } else {
                        /*
                         * Stop the I/O in case of a fatal
                         * error.
                         */
                } else {
                        /*
                         * Stop the I/O in case of a fatal
                         * error.
                         */
+                       update_error_count(td, err);
                        return 1;
                }
        }
                        return 1;
                }
        }