From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4D035314B8C for ; Tue, 13 Jan 2026 20:23:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768335822; cv=none; b=PW5/olGRSoRGSpgeuAu/xKNDpUFWg25GVeU5w1NeERgAq8P8dOPlM4x0l17a4EGYcpg+0VpE3C0xDIVV9ddgVMZtE8SJi1ddsMQNl/8FCpkDVQcwUO0I+muW6jy5uXTIhXtCwdDAEToTm3dUK/VrZWECvL21r1iA9onLCmHWdoM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768335822; c=relaxed/simple; bh=XlE+bCW80iW5/YA8FQw4HMEkrwj/cUseo/dNGbfLUdQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=P/1siSwe3JAVYoX2S5GuA0fMhahtOdWLzWHIIPWKigLh9s6zH/TEGbyiLs/M4DK9ABc+r9ElIXxnsGzUZ980OzVEabJwmHd7E+/K8fLB1XOptuIxDHmar/0DjgKpvSFT/XOnUDvtlQ6DHZvXGvrv77hu3qn7iFbACXA+NGlIcVI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=YXBVDJh9; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b=lGISTEJw; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="YXBVDJh9"; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b="lGISTEJw" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1768335819; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=LoKrgEsjVmaXB8RR+lgvPaiMnjoQkqTVAO9hkcrceb0=; b=YXBVDJh9FGDz/fhc20b1v2waBJi7YSmy4ndAsZ8H4YoLlLw9EkxDX0IQT2wfEkkSPdvFtY W2EoqPqQMT9ZJn4GLUq/aDCISN7uq2b7z8J4UeCoxGZiu2jgKCnpXoYu6jOu53ugyyAX6Q 49hIDci/GNoLUPgxVgswfyDeN8bOuKo= Received: from mail-ua1-f69.google.com (mail-ua1-f69.google.com [209.85.222.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-328-grO-16DpMjOBhMdbOZBdmA-1; Tue, 13 Jan 2026 15:23:38 -0500 X-MC-Unique: grO-16DpMjOBhMdbOZBdmA-1 X-Mimecast-MFC-AGG-ID: grO-16DpMjOBhMdbOZBdmA_1768335817 Received: by mail-ua1-f69.google.com with SMTP id a1e0cc1a2514c-93f57cdeb11so9925183241.0 for ; Tue, 13 Jan 2026 12:23:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1768335817; x=1768940617; darn=vger.kernel.org; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=LoKrgEsjVmaXB8RR+lgvPaiMnjoQkqTVAO9hkcrceb0=; b=lGISTEJwYmj8D+TnRE9L60yJiwvWykSz8S46SdyBWapWszqAXmEgNcNdLiUwSUv5WU B9N2c1gaLwdQrTqAfEX4O0tPtS16oLplC3LBiTJpuXOg0ABmTbVJz1BatUGK5FkVTBD+ N9Oxjuc+iWyUtBRwJHCqO9XQZqyHjikkwkS20BbMsQm/etImLeHOSu0gosDXvRwNQ2sr PpjysVW5TSPvKLBlAEiA+Zj0lGoy52ulN42NTSiIEX9Uy3xbA/ce/yRdq+sbVSxzz04Y 6p5H1ibDBG1enRwaurfWqVoaUxzz8whci7oFA/xVN3lajbtnQNAxKKKfQ/QcC7lGLH0c Rylw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768335817; x=1768940617; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=LoKrgEsjVmaXB8RR+lgvPaiMnjoQkqTVAO9hkcrceb0=; b=BYau5XsTVZ+5ziFPTU5jw/HKmMLySCAGznWuLNwWMySQp9rv84rsbyYc9Grh3U65TD auJXfpo2DkqDVWowlMjILXGlfMPwAU1MXuJJUtjL215nECCF5Mp+zZSZDio6RQSkN5js 9yUqxVNILWUkcstSikZUfNJgSevL33gNaCGVrZJEt1DI64nwlBdVcLqvBNJRY8t+0qac KNor9pjJdQ1IgWH9cCXvNoqq9rKyZ+mgHPPtCGuzRdI8u9ZWHrJZ+w0cQFebf4jJ63I2 ywZ3udhrudhp39kXwP/ff13BatW0xdxxlO5NfCYZm+Kh0pFzn/f+cusAd/Xgl6F49Oyf SKaw== X-Forwarded-Encrypted: i=1; AJvYcCXf966gM9fiYiPFrHaiI7Dk7biCvhEdz94nPcIV3utsTxn0+gRmIGyeLQUpPg1SMowyYMOMgd9+2A09uxk=@vger.kernel.org X-Gm-Message-State: AOJu0Yz5eQ+hPpU78YIILwdiUgicftG1BQwYU/UDbY/E/ujek/HjYjMq dV40pjby9U425DDO3GeHuiUOEuLxdQf+bhyRtj7qI42kVBFhC7AJP/E3Hj7Oe+Dk1TVMV6eDPXj qZT7KOOSXpIvdlNgsZsUoG6yJSsS2YgvdoUmLlmxbrbqrheC5zDfUscXaIbpluuu/iw== X-Gm-Gg: AY/fxX5p+rCJje6QmLqkv8YfqDUp5X3LUxVFiZKhRfc0ODGb1m1qYz03PEzVT3Vaeho TG+pavprLuvjmmCw1O2uW+3D+om8PpXcDUSXydYaH7jAGa470af8RRSb+iIA3pt4Bztd7HT/fMI TFGSmE3Tyv7liG9cV1ok+XkWDbuAoCKE1dbTTitvblT2I2fy+JXWKpL+SZTpS3YYE4KVHlyqFOA LVItDohhznaF4FAjxl67zxAb9h3bFffkLaU5DSoiSppUSMpiD+HIyy8HaxyDvAuTrcLubmo1NMd KURXWsXRjE/QDQYniMtzSumsajL9/RmqZMgsNaXahxRD3HRN4NP0wXsxhbYq33n/EH9nobIZEBT 7y+ydRF6X1PJmU7wFBnNBGJpsiB19I1OYBUQKHOksm/Le X-Received: by 2002:a05:6122:546:b0:55b:305b:4e46 with SMTP id 71dfb90a1353d-563a0a2ea9bmr192514e0c.18.1768335817350; Tue, 13 Jan 2026 12:23:37 -0800 (PST) X-Received: by 2002:a05:6122:546:b0:55b:305b:4e46 with SMTP id 71dfb90a1353d-563a0a2ea9bmr192499e0c.18.1768335816996; Tue, 13 Jan 2026 12:23:36 -0800 (PST) Received: from redhat.com (c-73-183-52-120.hsd1.pa.comcast.net. [73.183.52.120]) by smtp.gmail.com with ESMTPSA id 71dfb90a1353d-5636f19be3csm12170952e0c.4.2026.01.13.12.23.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Jan 2026 12:23:36 -0800 (PST) Date: Tue, 13 Jan 2026 15:23:19 -0500 From: Brian Masney To: david.laight.linux@gmail.com Cc: Christian Brauner , Andrew Morton , Miklos Szeredi , Mark Brown , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, Alexander Viro , Andreas Dilger , Kees Cook , OGAWA Hirofumi , Theodore Ts'o Subject: Re: [PATCH next] fuse: Fix 'min: signedness error' in fuse_wr_pages() Message-ID: References: <20260113192243.73983-1-david.laight.linux@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260113192243.73983-1-david.laight.linux@gmail.com> User-Agent: Mutt/2.2.14 (2025-02-20) On Tue, Jan 13, 2026 at 07:22:43PM +0000, david.laight.linux@gmail.com wrote: > From: David Laight > > On 32bit systems 'pos' is s64 and everything else is 32bit so the > first argument to min() is signed - generating a warning. > On 64bit systems 'len' is 64bit unsigned forcing everything to unsigned. > > Fix by reworking the exprssion to completely avoid 64bit maths on 32bit. > Use DIV_ROUND_UP() instead of open-coding something equivalent. > > Note that the 32bit 'len' cannot overflow because the syscall interface > limits read/write (etc) to (INT_MAX - PAGE_SIZE) bytes (even on 64bit). > > Fixes: 0f5bb0cfb0b4 ("fs: use min() or umin() instead of min_t()") > Signed-off-by: David Laight Reported-by: Brian Masney Reviewed-by: Brian Masney This fixes the MIPS cross compiler error on arm64 that I reported. I also tested a native arm64 build. Brian