Re: [PATCH v2 4/5] zbd: Fix zbd_zone_idx()

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

 



On 08/29/18 21:15, Damien Le Moal wrote:
> For a zone size that is not a power of 2 number of sectors,
                                           ^^^^^^^^^^^^^^^^^^

That sentence looks weird. Should "number of sectors" perhaps be left out?

> f->zbd_info->zone_size_log2 is set to -1. So use bit shift in
> zbd_zone_idx() only if zone_size_log2 is not negative.
> 
> Signed-off-by: Damien Le Moal <damien.lemoal@xxxxxxx>
> ---
>  zbd.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/zbd.c b/zbd.c
> index e98c5a50..3aea8052 100644
> --- a/zbd.c
> +++ b/zbd.c
> @@ -31,7 +31,7 @@ static uint32_t zbd_zone_idx(const struct fio_file *f, uint64_t offset)
>  {
>  	uint32_t zone_idx;
>  
> -	if (f->zbd_info->zone_size_log2)
> +	if (f->zbd_info->zone_size_log2 > 0)
>  		zone_idx = offset >> f->zbd_info->zone_size_log2;
>  	else
>  		zone_idx = (offset >> 9) / f->zbd_info->zone_size;
> 

Otherwise this patch looks fine to me, hence:

Reviewed-by: Bart Van Assche <bvanassche@xxxxxxx>



[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