public inbox for linux-fsdevel@vger.kernel.org
 help / color / mirror / Atom feed
From: Damien Le Moal <dlemoal@kernel.org>
To: Christoph Hellwig <hch@infradead.org>,
	Andreas Hindborg <nmi@metaspace.dk>
Cc: "open list:ZONEFS FILESYSTEM" <linux-fsdevel@vger.kernel.org>,
	gost.dev@samsung.com, Andreas Hindborg <a.hindborg@samsung.com>,
	Naohiro Aota <naohiro.aota@wdc.com>,
	Johannes Thumshirn <jth@kernel.org>,
	open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] zonefs: do not use append if device does not support it
Date: Tue, 27 Jun 2023 13:45:38 +0900	[thread overview]
Message-ID: <31ceba83-9d06-8fc6-4688-d568a698a4cc@kernel.org> (raw)
In-Reply-To: <ZJpbUShJUL788r7u@infradead.org>

On 6/27/23 12:45, Christoph Hellwig wrote:
> On Mon, Jun 26, 2023 at 06:47:52PM +0200, Andreas Hindborg wrote:
>> From: "Andreas Hindborg (Samsung)" <nmi@metaspace.dk>
>>
>> Zonefs will try to use `zonefs_file_dio_append()` for direct sync writes even if
>> device `max_zone_append_sectors` is zero. This will cause the IO to fail as the
>> io vector is truncated to zero. It also causes a call to
>> `invalidate_inode_pages2_range()` with end set to UINT_MAX, which is probably
>> not intentional. Thus, do not use append when device does not support it.
> 
> How do you even manage to hit this code?  Zone Append is a mandatory
> feature and driver need to check it is available.

ublk driver probably is missing that check ? I have not looked at the code for
zone support.

But thinking of it, we probably would be better off having a generic check for
"q->limits.max_zone_append_sectors != 0" in blk_revalidate_disk_zones().

-- 
Damien Le Moal
Western Digital Research


  reply	other threads:[~2023-06-27  4:46 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-26 16:47 [PATCH] zonefs: do not use append if device does not support it Andreas Hindborg
2023-06-26 17:54 ` Johannes Thumshirn
2023-06-26 18:23   ` Andreas Hindborg (Samsung)
2023-06-27  0:21     ` Damien Le Moal
2023-06-27  5:45       ` Andreas Hindborg (Samsung)
2023-06-27  3:45 ` Christoph Hellwig
2023-06-27  4:45   ` Damien Le Moal [this message]
2023-06-27  4:48     ` Christoph Hellwig
2023-06-27  4:50       ` Damien Le Moal
2023-06-27  5:14     ` Andreas Hindborg (Samsung)

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=31ceba83-9d06-8fc6-4688-d568a698a4cc@kernel.org \
    --to=dlemoal@kernel.org \
    --cc=a.hindborg@samsung.com \
    --cc=gost.dev@samsung.com \
    --cc=hch@infradead.org \
    --cc=jth@kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=naohiro.aota@wdc.com \
    --cc=nmi@metaspace.dk \
    /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