From: Brian Masney <bmasney@redhat.com>
To: david.laight.linux@gmail.com
Cc: Christian Brauner <brauner@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
Miklos Szeredi <miklos@szeredi.hu>,
Mark Brown <broonie@kernel.org>,
linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
Alexander Viro <viro@zeniv.linux.org.uk>,
Andreas Dilger <adilger.kernel@dilger.ca>,
Kees Cook <kees@kernel.org>,
OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>,
Theodore Ts'o <tytso@mit.edu>
Subject: Re: [PATCH next] fuse: Fix 'min: signedness error' in fuse_wr_pages()
Date: Tue, 13 Jan 2026 15:23:19 -0500 [thread overview]
Message-ID: <aWapt9vh8EEGdFUG@redhat.com> (raw)
In-Reply-To: <20260113192243.73983-1-david.laight.linux@gmail.com>
On Tue, Jan 13, 2026 at 07:22:43PM +0000, david.laight.linux@gmail.com wrote:
> From: David Laight <david.laight.linux@gmail.com>
>
> 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 <david.laight.linux@gmail.com>
Reported-by: Brian Masney <bmasney@redhat.com>
Reviewed-by: Brian Masney <bmasney@redhat.com>
This fixes the MIPS cross compiler error on arm64 that I reported. I
also tested a native arm64 build.
Brian
next prev parent reply other threads:[~2026-01-13 20:23 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-13 19:22 [PATCH next] fuse: Fix 'min: signedness error' in fuse_wr_pages() david.laight.linux
2026-01-13 20:23 ` Brian Masney [this message]
2026-02-03 1:05 ` Nathan Chancellor
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aWapt9vh8EEGdFUG@redhat.com \
--to=bmasney@redhat.com \
--cc=adilger.kernel@dilger.ca \
--cc=akpm@linux-foundation.org \
--cc=brauner@kernel.org \
--cc=broonie@kernel.org \
--cc=david.laight.linux@gmail.com \
--cc=hirofumi@mail.parknet.co.jp \
--cc=kees@kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=miklos@szeredi.hu \
--cc=tytso@mit.edu \
--cc=viro@zeniv.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.