summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2018-02-12 10:18:32 -0700
committerJens Axboe <axboe@kernel.dk>2018-02-12 10:18:32 -0700
commit264e3d300d9aa2d9c5acdf8edbd3639fbec784a0 (patch)
tree33d6495c18dc75bd8ccd2810a5259dc8d0ceed8e
parent7fc08e9929fefc9a8a2008eddb2e2fcba33fd90a (diff)
downloadfio-264e3d300d9aa2d9c5acdf8edbd3639fbec784a0.tar.gz
fio-264e3d300d9aa2d9c5acdf8edbd3639fbec784a0.tar.bz2
io_u: convert zoned bug warning to fio_did_warn()
Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r--debug.h1
-rw-r--r--io_u.c10
2 files changed, 3 insertions, 8 deletions
diff --git a/debug.h b/debug.h
index d10d43e9..84d6fafd 100644
--- a/debug.h
+++ b/debug.h
@@ -42,6 +42,7 @@ static inline bool fio_did_warn(unsigned int mask)
enum {
FIO_WARN_ROOT_FLUSH = 1,
FIO_WARN_VERIFY_BUF = 2,
+ FIO_WARN_ZONED_BUG = 4,
};
#ifdef FIO_INC_DEBUG
diff --git a/io_u.c b/io_u.c
index 404c75b3..b54a79c7 100644
--- a/io_u.c
+++ b/io_u.c
@@ -163,7 +163,6 @@ static int __get_next_rand_offset_zoned_abs(struct thread_data *td,
{
struct zone_split_index *zsi;
uint64_t lastb, send, stotal;
- static int warned;
unsigned int v;
lastb = last_block(td, f, ddir);
@@ -192,10 +191,8 @@ bail:
* Should never happen
*/
if (send == -1U) {
- if (!warned) {
+ if (!fio_did_warn(FIO_WARN_ZONED_BUG))
log_err("fio: bug in zoned generation\n");
- warned = 1;
- }
goto bail;
} else if (send > lastb) {
/*
@@ -223,7 +220,6 @@ static int __get_next_rand_offset_zoned(struct thread_data *td,
{
unsigned int v, send, stotal;
uint64_t offset, lastb;
- static int warned;
struct zone_split_index *zsi;
lastb = last_block(td, f, ddir);
@@ -248,10 +244,8 @@ bail:
* Should never happen
*/
if (send == -1U) {
- if (!warned) {
+ if (!fio_did_warn(FIO_WARN_ZONED_BUG))
log_err("fio: bug in zoned generation\n");
- warned = 1;
- }
goto bail;
}