From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: From: Dmitry Fomichev Subject: [PATCH v2 14/36] zbd: initialize sectors with data at start time Date: Thu, 24 Dec 2020 11:11:57 +0900 Message-Id: <20201224021219.189727-15-dmitry.fomichev@wdc.com> In-Reply-To: <20201224021219.189727-1-dmitry.fomichev@wdc.com> References: <20201224021219.189727-1-dmitry.fomichev@wdc.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit To: Jens Axboe , fio@vger.kernel.org, Aravind Ramesh , Bart Van Assche , Naohiro Aota , Niklas Cassel Cc: Damien Le Moal , Shinichiro Kawasaki , Dmitry Fomichev List-ID: From: Aravind Ramesh Based on the flag enable_check_swd, which is false by default, fio does not initialize the swd value at startup, initializing the swd value to be zero, even if some zones have sectors with data. This can result in fio reflecting less than actual swd after a few writes are completed. In workloads where verify is enabled, fio resets all the zones and while resetting, it decrements the swd counter with the actual number of swds in that zone(swd-count - swd-in-zone), since swd-count is initialized to 0, it results in overflow of the variable causing unpredictable issues. So, initialize the swd to the correct value. Fixes: 409a4f291e7f ("zbd: avoid initializing swd when unnecessary") Signed-off-by: Aravind Ramesh Signed-off-by: Dmitry Fomichev --- zbd.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/zbd.c b/zbd.c index 563f941b..45d045e9 100644 --- a/zbd.c +++ b/zbd.c @@ -946,9 +946,6 @@ static void zbd_init_swd(struct fio_file *f) { uint64_t swd; - if (!enable_check_swd) - return; - swd = zbd_process_swd(f, SET_SWD); dprint(FD_ZBD, "%s(%s): swd = %" PRIu64 "\n", __func__, f->file_name, swd); -- 2.28.0