Make async IO verify offload handle errors properly
authorJens Axboe <jens.axboe@oracle.com>
Mon, 6 Jul 2009 11:51:05 +0000 (13:51 +0200)
committerJens Axboe <jens.axboe@oracle.com>
Mon, 6 Jul 2009 11:51:05 +0000 (13:51 +0200)
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
verify.c

index 978e77b836683c81f37061f8656a57b0193c0928..871a36de0ccaf71f9649fef5887ab3ce314f6a72 100644 (file)
--- a/verify.c
+++ b/verify.c
@@ -783,11 +783,24 @@ static void *verify_async_thread(void *data)
                        io_u = flist_entry(list.next, struct io_u, list);
                        flist_del_init(&io_u->list);
 
-                       ret |= verify_io_u(td, io_u);
+                       ret = verify_io_u(td, io_u);
                        put_io_u(td, io_u);
+                       if (!ret)
+                               continue;
+                       if (td->o.continue_on_error &&
+                           td_non_fatal_error(ret)) {
+                               update_error_count(td, ret);
+                               td_clear_error(td);
+                               ret = 0;
+                       }
                }
        } while (!ret);
 
+       if (ret) {
+               td_verror(td, ret, "async_verify");
+               td->terminate = 1;
+       }
+
 done:
        pthread_mutex_lock(&td->io_u_lock);
        td->nr_verify_threads--;