[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YPWUBhxhoaEp8Frn@casper.infradead.org>
Date: Mon, 19 Jul 2021 16:02:30 +0100
From: Matthew Wilcox <willy@...radead.org>
To: Gao Xiang <hsiangkao@...ux.alibaba.com>
Cc: linux-erofs@...ts.ozlabs.org, linux-fsdevel@...r.kernel.org,
LKML <linux-kernel@...r.kernel.org>,
Christoph Hellwig <hch@....de>,
"Darrick J . Wong" <djwong@...nel.org>,
Andreas Gruenbacher <andreas.gruenbacher@...il.com>
Subject: Re: [PATCH v3] iomap: support tail packing inline read
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.
If we're not going to do that first, then I recommend leaving the
IOMAP_INLINE case where it is and changing it to ...
if (iomap->type == IOMAP_INLINE)
return iomap_read_inline_data(inode, page, iomap, pos);
... and have iomap_read_inline_data() return the number of bytes that
it copied + zeroed (ie PAGE_SIZE - poff).
Powered by blists - more mailing lists