linux-erofs.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Gao Xiang <hsiangkao@linux.alibaba.com>
To: "Andreas Grünbacher" <andreas.gruenbacher@gmail.com>
Cc: "Darrick J . Wong" <djwong@kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Matthew Wilcox <willy@infradead.org>,
	Linux FS-devel Mailing List <linux-fsdevel@vger.kernel.org>,
	linux-erofs@lists.ozlabs.org, Christoph Hellwig <hch@lst.de>
Subject: Re: [PATCH v3] iomap: support tail packing inline read
Date: Mon, 19 Jul 2021 23:36:43 +0800	[thread overview]
Message-ID: <YPWcC0HYu1ICo3dc@B-P7TQMD6M-0146.local> (raw)
In-Reply-To: <CAHpGcM+V+_AxTBwp_eq6R3osH0CMA5N-o8bzBKW3uMsBZY6KWA@mail.gmail.com>

On Mon, Jul 19, 2021 at 05:31:51PM +0200, Andreas Grünbacher wrote:
> Am Mo., 19. Juli 2021 um 17:29 Uhr schrieb Gao Xiang
> <hsiangkao@linux.alibaba.com>:
> > On Mon, Jul 19, 2021 at 04:02:30PM +0100, Matthew Wilcox wrote:
> > > On Mon, Jul 19, 2021 at 10:47:47PM +0800, Gao Xiang wrote:
> > > > @@ -246,18 +245,19 @@ iomap_readpage_actor(struct inode *inode, loff_t pos, loff_t length, void *data,
> > > >     unsigned poff, plen;
> > > >     sector_t sector;
> > > >
> > > > -   if (iomap->type == IOMAP_INLINE) {
> > > > -           WARN_ON_ONCE(pos);
> > > > -           iomap_read_inline_data(inode, page, iomap);
> > > > -           return PAGE_SIZE;
> > > > -   }
> > > > -
> > > > -   /* zero post-eof blocks as the page may be mapped */
> > > >     iop = iomap_page_create(inode, page);
> > > > +   /* needs to skip some leading uptodated blocks */
> > > >     iomap_adjust_read_range(inode, iop, &pos, length, &poff, &plen);
> > > >     if (plen == 0)
> > > >             goto done;
> > > >
> > > > +   if (iomap->type == IOMAP_INLINE) {
> > > > +           iomap_read_inline_data(inode, page, iomap, pos);
> > > > +           plen = PAGE_SIZE - poff;
> > > > +           goto done;
> > > > +   }
> > >
> > > This is going to break Andreas' case that he just patched to work.
> > > GFS2 needs for there to _not_ be an iop for inline data.  That's
> > > why I said we need to sort out when to create an iop before moving
> > > the IOMAP_INLINE case below the creation of the iop.
> >
> > I have no idea how it breaks Andreas' case from the previous commit
> > message: "
> > iomap: Don't create iomap_page objects for inline files
> > In iomap_readpage_actor, don't create iop objects for inline inodes.
> > Otherwise, iomap_read_inline_data will set PageUptodate without setting
> > iop->uptodate, and iomap_page_release will eventually complain.
> >
> > To prevent this kind of bug from occurring in the future, make sure the
> > page doesn't have private data attached in iomap_read_inline_data.
> > "
> >
> > After this patch, iomap_read_inline_data() will set iop->uptodate with
> > iomap_set_range_uptodate() rather than set PageUptodate() directly,
> > so iomap_page_release won't complain.
> 
> Yes, that actually looks fine.

Yeah, although I admit it looks (maybe) somewhat sub-optimal, but I think
let's make it work correctly first. Then consider how to optimize it even
further (like drop iops or likewise...).

Just my humble suggestion of this from heart....

Thanks,
Gao Xiang

> 
> Thanks,
> Andreas

  reply	other threads:[~2021-07-19 15:37 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-19 14:47 Gao Xiang
2021-07-19 15:02 ` Matthew Wilcox
2021-07-19 15:13   ` Christoph Hellwig
2021-07-19 16:11     ` Gao Xiang
2021-07-19 16:31       ` Matthew Wilcox
2021-07-19 16:45         ` Gao Xiang
2021-07-19 15:29   ` Gao Xiang
2021-07-19 15:31     ` Andreas Grünbacher
2021-07-19 15:36       ` Gao Xiang [this message]
2021-07-20 11:23 ` Andreas Grünbacher
2021-07-20 12:10   ` Gao Xiang
2021-07-20 11:34 ` Andreas Grünbacher
2021-07-20 12:23   ` 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=YPWcC0HYu1ICo3dc@B-P7TQMD6M-0146.local \
    --to=hsiangkao@linux.alibaba.com \
    --cc=andreas.gruenbacher@gmail.com \
    --cc=djwong@kernel.org \
    --cc=hch@lst.de \
    --cc=linux-erofs@lists.ozlabs.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=willy@infradead.org \
    --subject='Re: [PATCH v3] iomap: support tail packing inline read' \
    /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

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).