From 31d23f47d5ee53f74fbf20e17e83c7cb42e39878 Mon Sep 17 00:00:00 2001 From: Dave Engberg Date: Sat, 23 Jul 2011 21:07:13 +0200 Subject: [PATCH] Fix bsrange read,write value option pairs The 'bs' and 'bssplit' configuration variables accept separate numbers for read and write operations if you separate them with a comma. For example: bssplit=1k/39:8k/50:64k/11,1k/29:8k/50:64k/21 The documentation for 'bsrange' says it works the same way, but if I try to specify two ranges with a comma, I get an error when I run the app. E.g. if I put this line in the configuration file: bsrange=1k-16k,2k-32k I get this error output: fio: pid=26861, err=22/file:engines/sync.c:62, func=xfer, error=Invalid argument This patch fixes it. Signed-off-by: Jens Axboe --- parse.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/parse.c b/parse.c index ad2782f0..3e15b546 100644 --- a/parse.c +++ b/parse.c @@ -453,6 +453,11 @@ static int __handle_option(struct fio_option *o, const char *ptr, void *data, strncpy(tmp, ptr, sizeof(tmp) - 1); + /* Handle bsrange with separate read,write values: */ + p1 = strchr(tmp, ','); + if (p1) + *p1 = '\0'; + p1 = strchr(tmp, '-'); if (!p1) { p1 = strchr(tmp, ':'); -- 2.25.1