Re: [PATCH] fuse: fs-verity: aoid out-of-range comparison

From: Arnd Bergmann

Date: Thu Jun 04 2026 - 15:54:27 EST


On Thu, Jun 4, 2026, at 19:41, Andy Shevchenko wrote:
> On Thu, Aug 01, 2024 at 10:45:01AM -0700, Richard Fung wrote:
>> > I think this was just defensive coding to ensure that the assignment to
>> > iov_len can't overflow regardless of the type of digest_size
>>
>> I agree with this. Removing it sounds good to me
>
> Where we are with this? I have just stumbled over this issue yesterday when
> tried to have `make W=1` clean build of fs/.

I have nine of these in my randconfig build tree tree at the moment, and
with my patches I get a clean build with the warning enabled, I sent
these patches when I first came across them, usually after a code change,
though some of them may be old:

drivers/block/rbd.c:6079:17: error: result of comparison of constant 2305843009213693948 with expression of type 'u32' (aka 'unsigned int') is always false [-Werror,-Wtautological-constant-out-of-range-compare]

net/ipv4/tcp_output.c:188:3: error: result of comparison of constant -1 with expression of type 'u8' (aka 'unsigned char') is always false [-Werror,-Wtautological-constant-out-of-range-compare]

drivers/infiniband/core/uverbs_ioctl.c:90:39: error: result of comparison of constant 65536 with expression of type 'u16' (aka 'unsigned short') is always false [-Werror,-Wtautological-constant-out-of-range-compare]

drivers/clk/actions/owl-pll.c:182:2: error: result of comparison of constant 2000 with expression of type 'u8' (aka 'unsi
gned char') is always false [-Werror,-Wtautological-constant-out-of-range-compare]

arch/arm/mach-omap2/wd_timer.c:89:3: error: result of comparison of constant 2000 with expression of type 'u8' (aka 'unsi
gned char') is always false [-Werror,-Wtautological-constant-out-of-range-compare]

fs/fuse/ioctl.c:130:18: error: result of comparison of constant 18446744073709551611 with expression of type '__u16' (aka
'unsigned short') is always false [-Werror,-Wtautological-constant-out-of-range-compare]

drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c:1630:32: error: result of comparison of constant 65536 with expression of type '
u16' (aka 'unsigned short') is always false [-Werror,-Wtautological-constant-out-of-range-compare]

arch/riscv/errata/sifive/errata.c:29:14: error: result of comparison of constant 9223372036854775815 with expression of t
ype 'unsigned long' is always true [-Werror,-Wtautological-constant-out-of-range-compare]
arch/riscv/errata/sifive/errata.c:42:14: error: result of comparison of constant 9223372036854775815 with expression of t
ype 'unsigned long' is always true [-Werror,-Wtautological-constant-out-of-range-compare]

drivers/gpu/drm/nouveau/nvkm/subdev/fb/gb202.c:17:37: error: result of comparison of constant 4503599627370495 with expre
ssion of type 'dma_addr_t' (aka 'unsigned int') is always false [-Werror,-Wtautological-constant-out-of-range-compare]

If you think there is a chance to enable it by default soon, I can
try to see which ones are still required and send them again.

Arnd