Re: [PATCH 3/3] zbd: ensure that global max open zones limit is respected

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

 



On Jun 24, 2021 / 17:23, Niklas Cassel wrote:
> From: Niklas Cassel <niklas.cassel@xxxxxxx>
> 
> Commit 219c662d3b12 ("zbd: introduce per job maximum open zones limit")
> Introduced a global max open zones limit stored in zbd_info->max_open_zones.
> 
> This commit also changed checks against td->o.max_open_zones in zbd_open_zone()
> with checks against zbd_info->max_open_zones.
> 
> It is obvious that zbd_info->max_open_zones was intended to replace
> td->o.max_open_zones in all code that is executed after zbd_setup_files().
> 
> The commit itself was needed since zbd_info is shared over different jobs,
> so it is important that the global limit of max open zones is the same,
> for different jobs targeting the same device.
> 
> The problem with this commit is that in zbd_convert_to_open_zone(),
> instead of replacing td->o.max_open_zones with zbd_info->max_open_zones,
> it incorrectly just removed the references to td->o.max_open_zones.
> 
> This caused commit 00ca8df5468e ("zbd: Fix max_open_zones checks")
> (written by another author) to incorrectly re-add the removed
> td->o.max_open_zones checks in zbd_convert_to_open_zone().
> The proper fix here should have been to add checks against
> zbd_info->max_open_zones instead of td->o.max_open_zones,
> just like the original author did for zbd_open_zone().
> 
> Replace all td->o.max_open_zones uses past zbd_setup_files() with
> zbd_info->max_open_zones, and force set td->o.max_open_zones to
> zbd_info->max_open_zones in zbd_setup_files(), so that even if checks are
> introduced against the wrong limit, fio will still respect the global limit.
> 
> Fixes: 00ca8df5468e ("zbd: Fix max_open_zones checks")
> Signed-off-by: Niklas Cassel <niklas.cassel@xxxxxxx>
> Cc: Alexey Dobriyan <adobriyan@xxxxxxxxx>
> Cc: Shin'ichiro Kawasaki <shinichiro.kawasaki@xxxxxxx>

Thank you for the fix. Looks good to me.

Reviewed-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@xxxxxxx>

-- 
Best Regards,
Shin'ichiro Kawasaki



[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