zbd: don't read past the WP on a read only workload with verify
authorAravind Ramesh <aravind.ramesh@wdc.com>
Thu, 13 Aug 2020 15:01:48 +0000 (17:01 +0200)
committerJens Axboe <axboe@kernel.dk>
Thu, 27 Aug 2020 18:27:36 +0000 (12:27 -0600)
commit0ed7d55e6610020c4642ddb246f6ce1ab697052d
treec24fc5f31ce84e7d983513ca8c17def31c68e89c
parent84106576cefbbd9f5dfa5ee33b245f77938d0269
zbd: don't read past the WP on a read only workload with verify

When running a read only workload with verify option enabled,
fio continues to read beyond the write pointer, and thus
reads a deallocated block, which contains data of a predefined
pattern, thus causing the verify to fail.

Thus, we cannot simply jump to accept for a read only workload
with verify option enabled, we must let the regular flow of
execution to continue, so that the check if offset > wp is
performed, so that we will return the address to a new zone,
rather than an address that is past the wp.

Reading past the wp is not a recent bug, it is possible to
reproduce this bug even before zone capacity was introduced.

However, with the introduction of zone capacity, filling a
zone now only writes up to zone capacity of a zone, making
it much easier to reproduce this bug.

Reviewed-by: Dmitry Fomichev <dmitry.fomichev@wdc.com>
Reviewed-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Signed-off-by: Aravind Ramesh <aravind.ramesh@wdc.com>
Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
zbd.c