Re: [PATCH 03/13] zbd: print max_active_zones limit error message

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

 



On Fri, Jul 07, 2023 at 12:14:55PM +0900, Shin'ichiro Kawasaki wrote:
> When zoned block devices have max_active_zones limit and when write
> operations exceed that limit, Linux block sub-system reports EOVERFLOW.
> However, the strerror() string for EOVERFLOW does not mention about
> max_active_zones then it confuses users.
> 
> To avoid the confusion, print additional error message to indicate the
> max_active_zones limit. For this purpose, add a hook function
> zbd_log_err() and call it from __io_u_log_error().
> 
> Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@xxxxxxx>
> ---
>  io_u.c |  2 ++
>  zbd.c  | 12 ++++++++++++
>  zbd.h  |  1 +
>  3 files changed, 15 insertions(+)
> 
> diff --git a/io_u.c b/io_u.c
> index 27b6c92a..07e5bac5 100644
> --- a/io_u.c
> +++ b/io_u.c
> @@ -1879,6 +1879,8 @@ static void __io_u_log_error(struct thread_data *td, struct io_u *io_u)
>  		io_ddir_name(io_u->ddir),
>  		io_u->offset, io_u->xfer_buflen);
>  
> +	zbd_log_err(td, io_u);
> +
>  	if (td->io_ops->errdetails) {
>  		char *err = td->io_ops->errdetails(io_u);
>  
> diff --git a/zbd.c b/zbd.c
> index 3069ad1d..047489db 100644
> --- a/zbd.c
> +++ b/zbd.c
> @@ -2222,3 +2222,15 @@ int zbd_do_io_u_trim(struct thread_data *td, struct io_u *io_u)
>  
>  	return io_u_completed;
>  }
> +
> +void zbd_log_err(const struct thread_data *td, const struct io_u *io_u)
> +{
> +	const struct fio_file *f = io_u->file;
> +
> +	if (td->o.zone_mode != ZONE_MODE_ZBD)
> +		return;
> +
> +	if (io_u->error == EOVERFLOW && f->zbd_info->max_active_zones)

Can't this simply be:
if (io_u->error == EOVERFLOW)

Since I assume that each BLK_STS_* in the block layer has to map to a unique
error code, so if we get a EOVERFLOW, it has to be because of a
BLK_STS_ZONE_ACTIVE_RESOURCE?


> +		log_err("%s: Exceeded max_active_zones limit. Check conditions of zones out of I/O ranges.\n",
> +			f->file_name);
> +}
> diff --git a/zbd.h b/zbd.h
> index a5cf59d1..5750a0b8 100644
> --- a/zbd.h
> +++ b/zbd.h
> @@ -105,6 +105,7 @@ enum fio_ddir zbd_adjust_ddir(struct thread_data *td, struct io_u *io_u,
>  enum io_u_action zbd_adjust_block(struct thread_data *td, struct io_u *io_u);
>  char *zbd_write_status(const struct thread_stat *ts);
>  int zbd_do_io_u_trim(struct thread_data *td, struct io_u *io_u);
> +void zbd_log_err(const struct thread_data *td, const struct io_u *io_u);
>  
>  static inline void zbd_close_file(struct fio_file *f)
>  {
> -- 
> 2.40.1
> 



[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