Re: [PATCH] btrfs: fix signedness issue in min()
From: David Sterba
Date: Fri Mar 14 2025 - 14:26:59 EST
On Fri, Mar 14, 2025 at 04:54:41PM +0100, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@xxxxxxxx>
>
> Comparing a u64 to an loff_t causes a warning in min()
>
> fs/btrfs/extent_io.c: In function 'extent_write_locked_range':
> include/linux/compiler_types.h:557:45: error: call to '__compiletime_assert_588' declared with attribute error: min(folio_pos(folio) + folio_size(folio) - 1, end) signedness error
> fs/btrfs/extent_io.c:2472:27: note: in expansion of macro 'min'
> 2472 | cur_end = min(folio_pos(folio) + folio_size(folio) - 1, end);
> | ^~~
>
> Use min_t() instead.
>
> Fixes: f286b1c72175 ("btrfs: prepare extent_io.c for future larger folio support")
> Signed-off-by: Arnd Bergmann <arnd@xxxxxxxx>
Thanks, there was another report and the upcoming for-next will have it
fixed.