linux-erofs.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@infradead.org>
To: "Andreas Grünbacher" <andreas.gruenbacher@gmail.com>,
	"Christoph Hellwig" <hch@infradead.org>,
	linux-erofs@lists.ozlabs.org,
	"Linux FS-devel Mailing List" <linux-fsdevel@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	"Darrick J. Wong" <djwong@kernel.org>,
	"Chao Yu" <chao@kernel.org>, "Liu Bo" <bo.liu@linux.alibaba.com>,
	"Joseph Qi" <joseph.qi@linux.alibaba.com>,
	"Liu Jiang" <gerry@linux.alibaba.com>
Subject: Re: [PATCH 1/2] iomap: support tail packing inline read
Date: Sat, 17 Jul 2021 16:01:38 +0100	[thread overview]
Message-ID: <YPLw0uc1jVKI8uKo@casper.infradead.org> (raw)
In-Reply-To: <YPLdSja/4FBsjss/@B-P7TQMD6M-0146.local>

On Sat, Jul 17, 2021 at 09:38:18PM +0800, Gao Xiang wrote:
> Sorry about some late. I've revised a version based on Christoph's
> version and Matthew's thought above. I've preliminary checked with
> EROFS, if it does make sense, please kindly help check on the gfs2
> side as well..

I don't understand how this bit works:

>  	struct page *page = ctx->cur_page;
> -	struct iomap_page *iop;
> +	struct iomap_page *iop = NULL;
>  	bool same_page = false, is_contig = false;
>  	loff_t orig_pos = pos;
>  	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;
> -	}
> +	if (iomap->type == IOMAP_INLINE && !pos)
> +		WARN_ON_ONCE(to_iomap_page(page) != NULL);
> +	else
> +		iop = iomap_page_create(inode, page);

Imagine you have a file with bytes 0-2047 in an extent which is !INLINE
and bytes 2048-2051 in the INLINE extent.  When you read the page, first
you create an iop for the !INLINE extent.  Then this function is called
again for the INLINE extent and you'll hit the WARN_ON_ONCE.  No?


  reply	other threads:[~2021-07-17 15:03 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-16  5:07 [PATCH 0/2] erofs: iomap support for tailpacking cases Gao Xiang
2021-07-16  5:07 ` [PATCH 1/2] iomap: support tail packing inline read Gao Xiang
2021-07-16  9:19   ` Christoph Hellwig
2021-07-16  9:46     ` Gao Xiang
2021-07-16 13:47     ` Matthew Wilcox
2021-07-16 14:38       ` Matthew Wilcox
2021-07-16 13:02   ` Matthew Wilcox
2021-07-16 13:56     ` Gao Xiang
2021-07-16 14:44       ` Matthew Wilcox
2021-07-16 15:03         ` Gao Xiang
2021-07-16 15:53           ` Andreas Grünbacher
2021-07-17 13:38             ` Gao Xiang
2021-07-17 15:01               ` Matthew Wilcox [this message]
2021-07-17 15:15                 ` Gao Xiang
2021-07-17 18:40                   ` Matthew Wilcox
2021-07-19 11:19                     ` Christoph Hellwig
2021-07-19 13:45                       ` Gao Xiang
2021-07-19 11:15               ` Christoph Hellwig
2021-07-19 13:31                 ` Gao Xiang
2021-07-16  5:07 ` [PATCH 2/2] erofs: convert all uncompressed cases to iomap 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=YPLw0uc1jVKI8uKo@casper.infradead.org \
    --to=willy@infradead.org \
    --cc=andreas.gruenbacher@gmail.com \
    --cc=bo.liu@linux.alibaba.com \
    --cc=chao@kernel.org \
    --cc=djwong@kernel.org \
    --cc=gerry@linux.alibaba.com \
    --cc=hch@infradead.org \
    --cc=joseph.qi@linux.alibaba.com \
    --cc=linux-erofs@lists.ozlabs.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --subject='Re: [PATCH 1/2] 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).