From: Gao Xiang <hsiangkao@linux.alibaba.com>
To: Matthew Wilcox <willy@infradead.org>,
Andreas Gruenbacher <agruenba@redhat.com>
Cc: linux-xfs@vger.kernel.org, Theodore Ts'o <tytso@mit.edu>,
"Darrick J . Wong" <djwong@kernel.org>,
gfs2@lists.linux.dev, Andreas Dilger <adilger.kernel@dilger.ca>,
linux-fsdevel@vger.kernel.org,
Andrew Morton <akpm@linux-foundation.org>,
linux-ext4@vger.kernel.org, linux-erofs@lists.ozlabs.org
Subject: Re: [PATCH 2/3] mm: Add folio_fill_tail() and use it in iomap
Date: Sat, 11 Nov 2023 12:02:47 +0800 [thread overview]
Message-ID: <33d6a487-5913-fefd-2a45-d8d397e6f6ba@linux.alibaba.com> (raw)
In-Reply-To: <ZU5jx2QeujE+868t@casper.infradead.org>
On 2023/11/11 01:09, Matthew Wilcox wrote:
> On Thu, Nov 09, 2023 at 10:50:45PM +0100, Andreas Gruenbacher wrote:
>> On Tue, Nov 7, 2023 at 10:27 PM Matthew Wilcox (Oracle)
>> <willy@infradead.org> wrote:
>>> +static inline void folio_fill_tail(struct folio *folio, size_t offset,
>>> + const char *from, size_t len)
>>> +{
>>> + char *to = kmap_local_folio(folio, offset);
>>> +
>>> + VM_BUG_ON(offset + len > folio_size(folio));
>>> +
>>> + if (folio_test_highmem(folio)) {
>>> + size_t max = PAGE_SIZE - offset_in_page(offset);
>>> +
>>> + while (len > max) {
>>> + memcpy(to, from, max);
>>> + kunmap_local(to);
>>> + len -= max;
>>> + from += max;
>>> + offset += max;
>>> + max = PAGE_SIZE;
>>> + to = kmap_local_folio(folio, offset);
>>> + }
>>> + }
>>> +
>>> + memcpy(to, from, len);
>>> + to = folio_zero_tail(folio, offset, to);
>>
>> This needs to be:
>>
>> to = folio_zero_tail(folio, offset + len, to + len);
>
> Oh, wow, that was stupid of me. I only ran an xfstests against ext4,
> which doesn't exercise this code, not gfs2 or erofs. Thanks for
> fixing this up.
Assuming that is for the next cycle (no rush), I will also test
this patch and feedback later since I'm now working on other
stuffs.
Thanks,
Gao Xiang
next prev parent reply other threads:[~2023-11-11 5:04 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-07 21:26 [PATCH 0/3] Add folio_zero_tail() and folio_fill_tail() Matthew Wilcox (Oracle)
2023-11-07 21:26 ` [PATCH 1/3] mm: Add folio_zero_tail() and use it in ext4 Matthew Wilcox (Oracle)
2023-11-08 23:06 ` Andrew Morton
2023-11-09 0:12 ` Andreas Grünbacher
2023-11-09 17:27 ` Andrew Morton
2023-11-09 17:37 ` Matthew Wilcox
2023-11-09 21:50 ` Andreas Gruenbacher
2023-11-07 21:26 ` [PATCH 2/3] mm: Add folio_fill_tail() and use it in iomap Matthew Wilcox (Oracle)
2023-11-09 21:50 ` Andreas Gruenbacher
2023-11-10 17:09 ` Matthew Wilcox
2023-11-10 17:50 ` Andreas Grünbacher
2023-11-11 4:02 ` Gao Xiang [this message]
2023-11-07 21:26 ` [PATCH 3/3] gfs2: Convert stuffed_readpage() to stuffed_read_folio() Matthew Wilcox (Oracle)
2023-11-09 21:52 ` Andreas Gruenbacher
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=33d6a487-5913-fefd-2a45-d8d397e6f6ba@linux.alibaba.com \
--to=hsiangkao@linux.alibaba.com \
--cc=adilger.kernel@dilger.ca \
--cc=agruenba@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=djwong@kernel.org \
--cc=gfs2@lists.linux.dev \
--cc=linux-erofs@lists.ozlabs.org \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-xfs@vger.kernel.org \
--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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).