mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mauricio Faria de Oliveira <mfo@igalia.com>
To: Keith Busch <kbusch@kernel.org>
Cc: Jens Axboe <axboe@kernel.dk>, Christoph Hellwig <hch@lst.de>,
	Sagi Grimberg <sagi@grimberg.me>, Chao Shi <coshi036@gmail.com>,
	kernel-dev@igalia.com, linux-nvme@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] nvme: reject completions for requests that are not in flight
Date: Wed, 04 Nov 2026 17:21:07 -0300	[thread overview]
Message-ID: <610c32b5a2e5e36844071a367356aed6@igalia.com> (raw)
In-Reply-To: <auuRhVO8nZHM-MwY@kbusch-mbp>

On 2026-11-04 17:11, Keith Busch wrote:
> On Wed, Nov 04, 2026 at 04:46:12PM -0300, Mauricio Faria de Oliveira wrote:
>> On 2026-11-03 17:06, Keith Busch wrote:
>> > On Tue, Nov 03, 2026 at 04:54:27PM -0300, Mauricio Faria de Oliveira wrote:
>> >> For the former question, I'd imagine other block drivers might be
>> >> subject to a similar issue, under incorrect completions, and can take a
>> >> look at this later. I'd appreciate feedback on the points above before
>> >> trying to address it generically in the block layer, if at all possible.
>> > 
>> > Here's my real concern: the proposal is a race. Another CPU can change
>> > the request state to in-flight, and this code will declare it complete
>> > before the hardware even saw it. It's a silent data corruption problem
>> > that we can't fix because it is impossible to tell the difference
>> > between a bogus and a legit completion at that point. This kind of
>> > hardware shouldn't be allowed to exist as it can't be used successfully
>> > when it behaves this way.
>> 
>> Could you please clarify? Not that I'm defending the patch; just so I
>> understand your point.
>> 
>> The reason I ask is, IIUIC, if another CPU changes the request state to
>> in-flight and wins the race over an incorrect completion that maps to
>> that request, the request is declared complete anyway, even without this
>> code, no?
> 
> Yes, the race I'm mentioning is pre-existing assuming we're dealing with
> this kind of protocol breaking hardware. It just can't be fixed on the
> kernel side, and the proposal trying to cater to it makes it painfully
> obvious. I'd rather crash the kernel than risk passing on corrupted data
> as a success.

Indeed, under risk, crashing sounds better. Thanks for clarifying.

-- 
Mauricio

  reply	other threads:[~2026-11-04 20:21 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-03 19:18 Mauricio Faria de Oliveira
2026-11-03 19:21 ` K
2026-11-03 19:41   ` Mauricio Faria de Oliveira
2026-11-03 19:43 ` Keith Busch
2026-11-03 19:47   ` Jens Axboe
2026-11-03 19:54   ` Mauricio Faria de Oliveira
2026-11-03 19:59     ` Jens Axboe
2026-11-03 20:06     ` Keith Busch
2026-11-04 19:46       ` Mauricio Faria de Oliveira
2026-11-04 20:01         ` Jens Axboe
2026-11-04 20:08           ` Mauricio Faria de Oliveira
2026-11-04 20:11         ` Keith Busch
2026-11-04 20:21           ` Mauricio Faria de Oliveira [this message]
  -- strict thread matches above, loose matches on Subject: below --
2026-05-22 15:30 Chao Shi
2026-05-25 20:27 ` Chao S
2026-05-27 14:19 ` Christoph Hellwig
2026-05-27 15:02   ` Jens Axboe
2026-07-15  0:03     ` Chao S
2026-05-27 15:00 ` Keith Busch

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=610c32b5a2e5e36844071a367356aed6@igalia.com \
    --to=mfo@igalia.com \
    --cc=axboe@kernel.dk \
    --cc=coshi036@gmail.com \
    --cc=hch@lst.de \
    --cc=kbusch@kernel.org \
    --cc=kernel-dev@igalia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=sagi@grimberg.me \
    /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

all inboxes | Powered by JetHome®