summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Fu <vincent.fu@wdc.com>2019-11-11 11:30:53 -0500
committerJens Axboe <axboe@kernel.dk>2019-11-14 14:07:22 -0700
commit78f59d40ab927e91f0b46573831d0fe1422ab5f3 (patch)
tree3e9359e5c8677123c940002687a983537f6e6be3
parentcc16261082a4d0f027cef9d019ad023129bf6012 (diff)
downloadfio-78f59d40ab927e91f0b46573831d0fe1422ab5f3.tar.gz
fio-78f59d40ab927e91f0b46573831d0fe1422ab5f3.tar.bz2
filesetup: improve LFSR init failure error message
Especially with small sample spaces, the LFSR random generator occasionally fails to initialize successfully. When this occurs, the error message refers to problems allocating a random map. Change the error message to explicitly mention the LFSR failure. OLD BEHAVIOR $ ./fio --name=test --ioengine=null --size=4k --random_generator=lfsr --rw=randread --randrepeat=0 test: (g=0): rw=randread, bs=(R) 4096B-4096B, (W) 4096B-4096B, (T) 4096B-4096B, ioengine=null, iodepth=1 fio-3.16-13-g998b-dirty Starting 1 process fio: failed allocating random map. If running a large number of jobs, try the 'norandommap' option or set 'softrandommap'. Or give a larger --alloc-size to fio. NEW BEHAVIOR $ ./fio --name=test --ioengine=null --size=4k --random_generator=lfsr --rw=randread --randrepeat=0 test: (g=0): rw=randread, bs=(R) 4096B-4096B, (W) 4096B-4096B, (T) 4096B-4096B, ioengine=null, iodepth=1 fio-3.16-37-g65ee Starting 1 process fio: failed initializing LFSR Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r--filesetup.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/filesetup.c b/filesetup.c
index 1d3094c1..7d54c9f1 100644
--- a/filesetup.c
+++ b/filesetup.c
@@ -1354,6 +1354,9 @@ bool init_random_map(struct thread_data *td)
if (!lfsr_init(&f->lfsr, blocks, seed, 0)) {
fio_file_set_lfsr(f);
continue;
+ } else {
+ log_err("fio: failed initializing LFSR\n");
+ return false;
}
} else if (!td->o.norandommap) {
f->io_axmap = axmap_new(blocks);