Re: [PATCH] mm: vmscan: fix get_swappiness() return value type

From: Matthew Wilcox
Date: Thu Sep 07 2023 - 00:54:12 EST


On Thu, Sep 07, 2023 at 12:40:45PM +0800, Zhiguo Jiang wrote:
> Fix bool to int of the get_swappiness() return value type in
> lruvec_is_sizable().
>
> The get_swappiness() return value type is int, but the
> get_swappiness() return value type is bool in lruvec_is_sizable().
> So there is a possibility of value overflow.

Have you looked at how the C spec defines int->bool conversion?