gfio: add error option group
[fio.git] / io_u.c
diff --git a/io_u.c b/io_u.c
index db0a6dc50d2d509c5445e5cde26899628ea03e1d..a4802fec66ead13be34fe7c6bc0429978f695497 100644 (file)
--- a/io_u.c
+++ b/io_u.c
@@ -78,7 +78,7 @@ static void mark_random_map(struct thread_data *td, struct io_u *io_u)
                                mask = -1UL;
                        else
                                mask = ((1UL << this_blocks) - 1) << bit;
-       
+
                        if (!(f->file_map[idx] & mask))
                                break;
 
@@ -310,7 +310,7 @@ static int get_next_block(struct thread_data *td, struct io_u *io_u,
                        ret = 1;
                }
        }
-       
+
        if (!ret) {
                if (offset != -1ULL)
                        io_u->offset = offset;
@@ -1290,10 +1290,12 @@ err_put:
 
 void io_u_log_error(struct thread_data *td, struct io_u *io_u)
 {
+       enum error_type_bit eb = td_error_type(io_u->ddir, io_u->error);
        const char *msg[] = { "read", "write", "sync", "datasync",
                                "sync_file_range", "wait", "trim" };
 
-
+       if (td_non_fatal_error(td, eb, io_u->error) && !td->o.error_dump)
+               return;
 
        log_err("fio: io_u error");
 
@@ -1432,8 +1434,10 @@ static void io_completed(struct thread_data *td, struct io_u *io_u,
                icd->error = io_u->error;
                io_u_log_error(td, io_u);
        }
-       if (icd->error && td_non_fatal_error(icd->error) &&
-           (td->o.continue_on_error & td_error_type(io_u->ddir, icd->error))) {
+       if (icd->error) {
+               enum error_type_bit eb = td_error_type(io_u->ddir, icd->error);
+               if (!td_non_fatal_error(td, eb, icd->error))
+                       return;
                /*
                 * If there is a non_fatal error, then add to the error count
                 * and clear all the errors.