RE: [PATCH] zbd: don't read past the WP on a read only workload with verify

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




> -----Original Message-----
> From: fio-owner@xxxxxxxxxxxxxxx <fio-owner@xxxxxxxxxxxxxxx> On Behalf
> Of Niklas Cassel
> Sent: Thursday, August 13, 2020 11:02 AM
> To: fio@xxxxxxxxxxxxxxx
> Cc: Damien Le Moal <Damien.LeMoal@xxxxxxx>; Shinichiro Kawasaki
> <shinichiro.kawasaki@xxxxxxx>; Aravind Ramesh
> <Aravind.Ramesh@xxxxxxx>; Niklas Cassel <Niklas.Cassel@xxxxxxx>
> Subject: [PATCH] zbd: don't read past the WP on a read only workload with
> verify
> 
> From: Aravind Ramesh <aravind.ramesh@xxxxxxx>
> 
> 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.
> 
> Signed-off-by: Aravind Ramesh <aravind.ramesh@xxxxxxx>
> Signed-off-by: Niklas Cassel <niklas.cassel@xxxxxxx>
> ---
> Patch made by Aravind, I simply rewrote the commit message.

Reviewed-by: Dmitry Fomichev <dmitry.fomichev@xxxxxxx>

> 
>  zbd.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/zbd.c b/zbd.c
> index e4a480b7..92936fe8 100644
> --- a/zbd.c
> +++ b/zbd.c
> @@ -1467,9 +1467,8 @@ enum io_u_action zbd_adjust_block(struct
> thread_data *td, struct io_u *io_u)
> 
>  	switch (io_u->ddir) {
>  	case DDIR_READ:
> -		if (td->runstate == TD_VERIFYING) {
> -			if (td_write(td))
> -				zb = zbd_replay_write_order(td, io_u, zb);
> +		if (td->runstate == TD_VERIFYING && td_write(td)) {
> +			zb = zbd_replay_write_order(td, io_u, zb);
>  			goto accept;
>  		}
>  		/*
> --
> 2.26.2





[Index of Archives]     [Linux Kernel]     [Linux SCSI]     [Linux IDE]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux