don't leave ignore_error_nr[etype] with 4 on blank input or error
authorTomohiro Kusumi <tkusumi@tuxera.com>
Wed, 7 Jun 2017 20:18:46 +0000 (23:18 +0300)
committerJens Axboe <axboe@fb.com>
Wed, 7 Jun 2017 20:23:26 +0000 (14:23 -0600)
This isn't a bug since td_non_fatal_error() checks errnos to ignore
by td->o.ignore_error[etype] being NULL or not, but it's still strange
to leave td->o.ignore_error_nr[etype] with 4 (or multiple of 4 on
error) when there aren't any.

Signed-off-by: Tomohiro Kusumi <tkusumi@tuxera.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
options.c

index 864e778..4214f24 100644 (file)
--- a/options.c
+++ b/options.c
@@ -306,8 +306,9 @@ static int ignore_error_type(struct thread_data *td, int etype, char *str)
                                error[i] = -error[i];
                }
                if (!error[i]) {
-                       log_err("Unknown error %s, please use number value \n",
+                       log_err("Unknown error %s, please use number value\n",
                                  fname);
+                       td->o.ignore_error_nr[etype] = 0;
                        free(error);
                        return 1;
                }
@@ -317,8 +318,10 @@ static int ignore_error_type(struct thread_data *td, int etype, char *str)
                td->o.continue_on_error |= 1 << etype;
                td->o.ignore_error_nr[etype] = i;
                td->o.ignore_error[etype] = error;
-       } else
+       } else {
+               td->o.ignore_error_nr[etype] = 0;
                free(error);
+       }
 
        return 0;