public inbox for linux-block@vger.kernel.org
 help / color / mirror / Atom feed
From: Damien Le Moal <dlemoal@kernel.org>
To: Christoph Hellwig <hch@infradead.org>
Cc: Jens Axboe <axboe@kernel.dk>, linux-block@vger.kernel.org
Subject: Re: [PATCH] block: fix partial zone append completion handling in req_bio_endio()
Date: Wed, 10 Jan 2024 15:18:28 +0900	[thread overview]
Message-ID: <599edd2f-e749-4d85-82f9-2322ff5c30dc@kernel.org> (raw)
In-Reply-To: <ZZ40YzBnZ639Zttm@infradead.org>

On 1/10/24 15:08, Christoph Hellwig wrote:
> On Wed, Jan 10, 2024 at 02:15:59PM +0900, Damien Le Moal wrote:
>> Partial completions of zone append request is not allowed but if a zone
>> append completion indicates a number of completed bytes different from
>> the original BIO size, only the BIO status is set to error. This leads
>> to bio_advance() not setting the BIO size to 0 and thus to not call
>> bio_endio() at the end of req_bio_endio().
>>
>> Make sure a partially completed zone append is failed and completed
>> immediately by forcing the completed number of bytes (nbytes) to be
>> equal to the BIO sizei, thus ensuring that bio_endio() is called.
> 
> This really is a should not ever happen case.  But if it does happen
> anyway for some reason, this is the right way to deal with it, so:

Yes, that is likely impossible for NVMe ZNS. But that is definitely in the realm
of the possible for SMR drives with zone append emulation using regular writes.
ATA drives will never partially complete, but SAS drives may do so.

> 
> Reviewed-by: Christoph Hellwig <hch@lst.de>

Thanks.

-- 
Damien Le Moal
Western Digital Research


  reply	other threads:[~2024-01-10  6:18 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-10  5:15 [PATCH] block: fix partial zone append completion handling in req_bio_endio() Damien Le Moal
2024-01-10  6:08 ` Christoph Hellwig
2024-01-10  6:18   ` Damien Le Moal [this message]
2024-01-10  8:22 ` Johannes Thumshirn
2024-01-10  9:29   ` 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=599edd2f-e749-4d85-82f9-2322ff5c30dc@kernel.org \
    --to=dlemoal@kernel.org \
    --cc=axboe@kernel.dk \
    --cc=hch@infradead.org \
    --cc=linux-block@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