From: Matthew Wilcox <willy@infradead.org>
To: Andreas Gruenbacher <agruenba@redhat.com>
Cc: "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: Thu, 29 Jul 2021 13:43:38 +0100 [thread overview]
Message-ID: <YQKiekbn8wbKklzU@casper.infradead.org> (raw)
In-Reply-To: <CAHc6FU5E9AdiH7SnfADteOVdttNFGO1EN0PoiYYVyaftCJ1Mqw@mail.gmail.com>
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.
next prev parent reply other threads:[~2021-07-29 12:44 UTC|newest]
Thread overview: 4+ 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:54 ` Andreas Gruenbacher
2021-07-29 12:43 ` Matthew Wilcox [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=YQKiekbn8wbKklzU@casper.infradead.org \
--to=willy@infradead.org \
--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 \
/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 NNTP newsgroup(s).