All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fio: simplify zoneskip= validness check
@ 2021-02-14 19:16 Alexey Dobriyan
  2021-02-15  3:41 ` Dmitry Fomichev
  0 siblings, 1 reply; 2+ messages in thread
From: Alexey Dobriyan @ 2021-02-14 19:16 UTC (permalink / raw)
  To: axboe; +Cc: fio

Simply check the remainder

	(zoneskip % zone_size) > 0

It will do the right thing for all zoneskip= values, and
zonesize being positive is checked earlier.

Signed-off-by: Alexey Dobriyan (SK hynix) <adobriyan@gmail.com>
---

 zbd.c |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

--- a/zbd.c
+++ b/zbd.c
@@ -285,9 +285,7 @@ static bool zbd_verify_sizes(void)
 				return false;
 			}
 
-			if (td->o.zone_skip &&
-			    (td->o.zone_skip < td->o.zone_size ||
-			     td->o.zone_skip % td->o.zone_size)) {
+			if (td->o.zone_skip % td->o.zone_size) {
 				log_err("%s: zoneskip %llu is not a multiple of the device zone size %llu.\n",
 					f->file_name, (unsigned long long) td->o.zone_skip,
 					(unsigned long long) td->o.zone_size);


^ permalink raw reply	[flat|nested] 2+ messages in thread

* RE: [PATCH] fio: simplify zoneskip= validness check
  2021-02-14 19:16 [PATCH] fio: simplify zoneskip= validness check Alexey Dobriyan
@ 2021-02-15  3:41 ` Dmitry Fomichev
  0 siblings, 0 replies; 2+ messages in thread
From: Dmitry Fomichev @ 2021-02-15  3:41 UTC (permalink / raw)
  To: Alexey Dobriyan, axboe; +Cc: fio

> -----Original Message-----
> From: Alexey Dobriyan <adobriyan@gmail.com>
> Sent: Sunday, February 14, 2021 2:17 PM
> To: axboe@kernel.dk
> Cc: fio@vger.kernel.org
> Subject: [PATCH] fio: simplify zoneskip= validness check

fio: -> zbd:?

> 
> Simply check the remainder
> 
> 	(zoneskip % zone_size) > 0
> 
> It will do the right thing for all zoneskip= values, and
> zonesize being positive is checked earlier.
> 
> Signed-off-by: Alexey Dobriyan (SK hynix) <adobriyan@gmail.com>

With the small nit above, looks good.
Reviewed-by: Dmitry Fomichev <dmitry.fomichev@wdc.com>

> ---
> 
>  zbd.c |    4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> --- a/zbd.c
> +++ b/zbd.c
> @@ -285,9 +285,7 @@ static bool zbd_verify_sizes(void)
>  				return false;
>  			}
> 
> -			if (td->o.zone_skip &&
> -			    (td->o.zone_skip < td->o.zone_size ||
> -			     td->o.zone_skip % td->o.zone_size)) {
> +			if (td->o.zone_skip % td->o.zone_size) {
>  				log_err("%s: zoneskip %llu is not a multiple of
> the device zone size %llu.\n",
>  					f->file_name, (unsigned long long)
> td->o.zone_skip,
>  					(unsigned long long) td-
> >o.zone_size);

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-02-15  3:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-14 19:16 [PATCH] fio: simplify zoneskip= validness check Alexey Dobriyan
2021-02-15  3:41 ` Dmitry Fomichev

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.