From: Gao Xiang <hsiangkao@linux.alibaba.com>
To: Matthew Wilcox <willy@infradead.org>
Cc: Andreas Gruenbacher <agruenba@redhat.com>,
linux-erofs@lists.ozlabs.org,
linux-fsdevel <linux-fsdevel@vger.kernel.org>,
linux-xfs@vger.kernel.org, "Darrick J. Wong" <djwong@kernel.org>,
Christoph Hellwig <hch@lst.de>
Subject: Re: [PATCH v2] iomap: Support inline data with block size < page size
Date: Fri, 30 Jul 2021 01:26:08 +0800 [thread overview]
Message-ID: <YQLksEHixW+4RYqJ@B-P7TQMD6M-0146.local> (raw)
In-Reply-To: <YQKiekbn8wbKklzU@casper.infradead.org>
Hi Matthew,
On Thu, Jul 29, 2021 at 01:43:38PM +0100, Matthew Wilcox wrote:
> On Thu, Jul 29, 2021 at 05:54:56AM +0200, Andreas Gruenbacher wrote:
> > > - /* inline data must start page aligned in the file */
> > > - if (WARN_ON_ONCE(offset_in_page(iomap->offset)))
> > > - return -EIO;
> >
> > Maybe add a WARN_ON_ONCE(size > PAGE_SIZE - poff) here?
>
> Sure!
>
> > > if (WARN_ON_ONCE(size > PAGE_SIZE -
> > > offset_in_page(iomap->inline_data)))
> > > return -EIO;
> > > if (WARN_ON_ONCE(size > iomap->length))
> > > return -EIO;
> > > - if (WARN_ON_ONCE(page_has_private(page)))
> > > - return -EIO;
> > > + if (poff > 0)
> > > + iomap_page_create(inode, page);
> > >
> > > - addr = kmap_atomic(page);
> > > + addr = kmap_atomic(page) + poff;
> >
> > Maybe kmap_local_page?
>
> Heh, I do that later when I convert to folios (there is no
> kmap_atomic_folio(), only kmap_local_folio()). But I can throw that
> in here too.
I don't find any critical point with this patch (and agree with Andreas'
suggestion), maybe some followup folio work could get more input about
this. I'll evaluate them all together later.
Thanks,
Gao Xiang
WARNING: multiple messages have this Message-ID (diff)
From: Gao Xiang <hsiangkao@linux.alibaba.com>
To: Matthew Wilcox <willy@infradead.org>
Cc: Andreas Gruenbacher <agruenba@redhat.com>,
"Darrick J. Wong" <djwong@kernel.org>,
linux-xfs@vger.kernel.org,
linux-fsdevel <linux-fsdevel@vger.kernel.org>,
linux-erofs@lists.ozlabs.org, Christoph Hellwig <hch@lst.de>
Subject: Re: [PATCH v2] iomap: Support inline data with block size < page size
Date: Fri, 30 Jul 2021 01:26:08 +0800 [thread overview]
Message-ID: <YQLksEHixW+4RYqJ@B-P7TQMD6M-0146.local> (raw)
In-Reply-To: <YQKiekbn8wbKklzU@casper.infradead.org>
Hi Matthew,
On Thu, Jul 29, 2021 at 01:43:38PM +0100, Matthew Wilcox wrote:
> On Thu, Jul 29, 2021 at 05:54:56AM +0200, Andreas Gruenbacher wrote:
> > > - /* inline data must start page aligned in the file */
> > > - if (WARN_ON_ONCE(offset_in_page(iomap->offset)))
> > > - return -EIO;
> >
> > Maybe add a WARN_ON_ONCE(size > PAGE_SIZE - poff) here?
>
> Sure!
>
> > > if (WARN_ON_ONCE(size > PAGE_SIZE -
> > > offset_in_page(iomap->inline_data)))
> > > return -EIO;
> > > if (WARN_ON_ONCE(size > iomap->length))
> > > return -EIO;
> > > - if (WARN_ON_ONCE(page_has_private(page)))
> > > - return -EIO;
> > > + if (poff > 0)
> > > + iomap_page_create(inode, page);
> > >
> > > - addr = kmap_atomic(page);
> > > + addr = kmap_atomic(page) + poff;
> >
> > Maybe kmap_local_page?
>
> Heh, I do that later when I convert to folios (there is no
> kmap_atomic_folio(), only kmap_local_folio()). But I can throw that
> in here too.
I don't find any critical point with this patch (and agree with Andreas'
suggestion), maybe some followup folio work could get more input about
this. I'll evaluate them all together later.
Thanks,
Gao Xiang
next prev parent reply other threads:[~2021-07-29 17:26 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-29 3:23 [PATCH v2] iomap: Support inline data with block size < page size Matthew Wilcox (Oracle)
2021-07-29 3:23 ` Matthew Wilcox (Oracle)
2021-07-29 3:54 ` Andreas Gruenbacher
2021-07-29 3:54 ` Andreas Gruenbacher
2021-07-29 12:43 ` Matthew Wilcox
2021-07-29 12:43 ` Matthew Wilcox
2021-07-29 17:26 ` Gao Xiang [this message]
2021-07-29 17:26 ` Gao Xiang
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=YQLksEHixW+4RYqJ@B-P7TQMD6M-0146.local \
--to=hsiangkao@linux.alibaba.com \
--cc=agruenba@redhat.com \
--cc=djwong@kernel.org \
--cc=hch@lst.de \
--cc=linux-erofs@lists.ozlabs.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-xfs@vger.kernel.org \
--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 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.