From: Brian Foster <bfoster@redhat.com>
To: Nickolai Zeldovich <nickolai@csail.mit.edu>
Cc: Matthew Wilcox <willy@infradead.org>, Jan Kara <jack@suse.cz>,
Andrew Morton <akpm@linux-foundation.org>,
Theodore Ts'o <tytso@mit.edu>,
linux-fsdevel@vger.kernel.org, linux-mm@kvack.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v1] mm/truncate: fix the zeroing end of pagecache_isize_extended()
Date: Tue, 20 Oct 2026 06:50:45 -0400 [thread overview]
Message-ID: <atdHhW7JU8j5pozl@bfoster> (raw)
In-Reply-To: <CADGQE7H91ZwPgUzPHoAJmF3WjzRKxeQkQcV8+BLdGn7+kkEduA@mail.gmail.com>
On Mon, Oct 19, 2026 at 03:54:14PM -0400, Nickolai Zeldovich wrote:
> On Mon, Oct 19, 2026 at 3:35 PM Brian Foster <bfoster@redhat.com> wrote:
> > > --- a/mm/truncate.c
> > > +++ b/mm/truncate.c
> > > @@ -878,8 +878,7 @@ void pagecache_isize_extended(struct inode *inode, loff_t from, loff_t to)
> > > unsigned int offset, end;
> > >
> > > offset = from - folio_pos(folio);
> > > - end = min_t(unsigned int, to - folio_pos(folio),
> > > - folio_size(folio));
> > > + end = min_t(loff_t, to - folio_pos(folio), folio_size(folio));
> >
> > Good catch...
> >
> > folio_size() returns size_t and folio_zero_segment() expects size_t for
> > the offset params. Perhaps we should that instead of loff_t?
>
> size_t is (unsigned int) on 32-bit machines, like i386, which has the
> same issue (reproducer from the patch).
>
Ah, Ok. So loff_t makes sense for the min_t(). I do still wonder if it
makes sense to switch offset and end to size_t while we're here though.
Brian
prev parent reply other threads:[~2026-10-20 10:50 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-16 22:27 Nickolai Zeldovich
2026-10-19 11:30 ` Jan Kara
2026-10-19 19:35 ` Brian Foster
2026-10-19 19:54 ` Nickolai Zeldovich
2026-10-20 10:50 ` Brian Foster [this message]
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=atdHhW7JU8j5pozl@bfoster \
--to=bfoster@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=jack@suse.cz \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=nickolai@csail.mit.edu \
--cc=tytso@mit.edu \
--cc=willy@infradead.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®