Re: [PATCH 2/5] zbd: Fix type of local variable min_bs

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

 



On Wed, Oct 13, 2021 at 03:09:00PM +0900, Shin'ichiro Kawasaki wrote:
> In zbd.c, thread option min_bs[] is referred and stored in the local
> variable min_bs. Elements of min_bs[] have type unsigned long long, but
> the local variable min_bs has type uint32_t. When an element of min_bs[]
> has value larger than UINT32_MAX, it overflows on assignment to min_bs.
> 
> To avoid the overflow, fix type of the local variable min_bs from
> uint32_t to uint64_t. Use uint64_t rather than unsigned long long to be
> more specific about data size and consistency in zbd.c. The variable is
> passed to the helper function zbd_find_zone(), then fix the type of the
> argument of the function also.
> 
> Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@xxxxxxx>
> ---

Reviewed-by: Niklas Cassel <niklas.cassel@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