From: Christoph Hellwig <hch@infradead.org>
To: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Cc: linux-fsdevel@vger.kernel.org,
Johannes Thumshirn <johannes.thumshirn@wdc.com>
Subject: Re: [PATCH 3/3] zonefs: fix zonefs_iomap_begin() for reads
Date: Mon, 6 Jun 2022 23:09:39 -0700 [thread overview]
Message-ID: <Yp7rox7SRvKcsZPT@infradead.org> (raw)
In-Reply-To: <20220603114939.236783-4-damien.lemoal@opensource.wdc.com>
On Fri, Jun 03, 2022 at 08:49:39PM +0900, Damien Le Moal wrote:
> If a read operation (e.g. a readahead) is issued to a sequential zone
> file with an offset exactly equal to the current file size, the iomap
> type will be set to IOMAP_UNWRITTEN, which will prevent an IO, but the
> iomap length is always calculated as 0. This causes a WARN_ON() in
> iomap_iter():
Is there a testsuite somewhere with a reproducer?
> diff --git a/fs/zonefs/super.c b/fs/zonefs/super.c
> index 123464d2145a..64f4ceb6f579 100644
> --- a/fs/zonefs/super.c
> +++ b/fs/zonefs/super.c
> @@ -144,7 +144,7 @@ static int zonefs_iomap_begin(struct inode *inode, loff_t offset, loff_t length,
> iomap->type = IOMAP_MAPPED;
> if (flags & IOMAP_WRITE)
> length = zi->i_max_size - offset;
> - else
> + else if (offset < isize)
> length = min(length, isize - offset);
So you still report an IOMAP_UNWRITTEN extent for the whole size of
the requst past EOF? Looking at XFS we do return the whole requested
length, but do return it as HOLE. Maybe we need to clarify the behavior
here and document it.
next prev parent reply other threads:[~2022-06-07 6:09 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-03 11:49 [PATCH 0/3] zonefs fixes Damien Le Moal
2022-06-03 11:49 ` [PATCH 1/3] zonefs: fix handling of explicit_open option on mount Damien Le Moal
2022-06-07 6:01 ` Christoph Hellwig
2022-06-07 8:46 ` Johannes Thumshirn
2022-06-03 11:49 ` [PATCH 2/3] zonefs: Do not ignore explicit_open with active zone limit Damien Le Moal
2022-06-07 6:02 ` Christoph Hellwig
2022-06-03 11:49 ` [PATCH 3/3] zonefs: fix zonefs_iomap_begin() for reads Damien Le Moal
2022-06-07 6:09 ` Christoph Hellwig [this message]
2022-06-07 6:53 ` Damien Le Moal
2022-06-07 10:09 ` Christoph Hellwig
2022-06-07 10:25 ` Damien Le Moal
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=Yp7rox7SRvKcsZPT@infradead.org \
--to=hch@infradead.org \
--cc=damien.lemoal@opensource.wdc.com \
--cc=johannes.thumshirn@wdc.com \
--cc=linux-fsdevel@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).