options: warn if we fail to make sense of buffer_pattern
[fio.git] / options.c
index 484efc1a2ebe8dd438dceff5a2a1307c8eaf7c0b..5f4a8ec2923040ed35c89aaecacb906867cda47d 100644 (file)
--- a/options.c
+++ b/options.c
@@ -672,7 +672,7 @@ static int str_numa_mpol_cb(void *data, char *input)
                }
                td->o.numa_memnodes = strdup(nodelist);
                numa_free_nodemask(verify_bitmask);
-                
+
                break;
        case MPOL_LOCAL:
        case MPOL_DEFAULT:
@@ -985,8 +985,8 @@ static int pattern_cb(char *pattern, unsigned int max_size,
 
        if (i == 1) {
                /*
-                * The code in verify_io_u_pattern assumes a single byte pattern
-                * fills the whole verify pattern buffer.
+                * The code in verify_io_u_pattern assumes a single byte
+                * pattern fills the whole verify pattern buffer.
                 */
                memset(pattern, pattern[0], max_size);
        }
@@ -1003,10 +1003,13 @@ static int str_buffer_pattern_cb(void *data, const char *input)
        ret = pattern_cb(td->o.buffer_pattern, MAX_PATTERN_SIZE, input,
                                &td->o.buffer_pattern_bytes);
 
-       if (!ret) {
+       if (!ret && td->o.buffer_pattern_bytes) {
                td->o.refill_buffers = 0;
                td->o.scramble_buffers = 0;
                td->o.zero_buffers = 0;
+       } else {
+               log_err("fio: failed parsing pattern `%s`\n", input);
+               ret = 1;
        }
 
        return ret;
@@ -1542,7 +1545,7 @@ struct fio_option fio_options[FIO_MAX_OPTS] = {
                          },
 #endif
 #ifdef CONFIG_LIBHDFS
-                         { .ival = "hdfs",
+                         { .ival = "libhdfs",
                            .help = "Hadoop Distributed Filesystem (HDFS) engine"
                          },
 #endif