Re: [PATCH 06/11] zbd: fix zone reset condition for verify_backlog option

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

 



On Fri, 2022-10-21 at 15:34 +0900, Shin'ichiro Kawasaki wrote:
> When verify options is specified, zbd_file_reset() resets zones only

s/verify options is specified/data verification is requested/

> when td status is not TD_VERIFYING so that the data to read back for
> verify is not wiped out. However, when verify_backlog option is set, the
> verify data can be left even if td status is not TD_VERIFYING . This

There is an extra space before the comma above...

> causes verify failure.
> 
> Fix this by improving the condition to reset zones in zbd_file_reset().
> Refer not only td status but also verify_batch and io_hist_len values to
> avoid zone reset when verify_backlog option is set. This is same check
> as check_get_verify().
> 
> Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@xxxxxxx>

With the commit message nits, looks good.

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

> ---
>  zbd.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/zbd.c b/zbd.c
> index 3855ab0e..b2f43860 100644
> --- a/zbd.c
> +++ b/zbd.c
> @@ -1246,6 +1246,7 @@ void zbd_file_reset(struct thread_data *td, struct
> fio_file *f)
>  {
>         struct fio_zone_info *zb, *ze;
>         uint64_t swd;
> +       bool verify_ongoing;
>  
>         if (!f->zbd_info || !td_write(td))
>                 return;
> @@ -1262,7 +1263,10 @@ void zbd_file_reset(struct thread_data *td, struct
> fio_file *f)
>          * writing any data to avoid that a zone reset has to be issued while
>          * writing data, which causes data loss.
>          */
> -       if (td->o.verify != VERIFY_NONE && td->runstate != TD_VERIFYING)
> +       verify_ongoing = td->runstate == TD_VERIFYING || td->verify_batch;
> +       if (td->io_hist_len && td->o.verify_backlog)
> +               verify_ongoing = td->io_hist_len % td->o.verify_backlog;
> +       if (td->o.verify != VERIFY_NONE && !verify_ongoing)
>                 zbd_reset_zones(td, f, zb, ze);
>         zbd_reset_write_cnt(td, f);
>  }





[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