public inbox for linux-block@vger.kernel.org
 help / color / mirror / Atom feed
From: Ondrej Kozina <okozina@redhat.com>
To: linux-block@vger.kernel.org
Cc: axboe@kernel.dk, gmazyland@gmail.com, regressions@lists.linux.dev
Subject: Re: [PATCH] block: cleanup and fix batch completion adding conditions
Date: Fri, 28 Feb 2025 12:59:05 +0100	[thread overview]
Message-ID: <71bbd596-a3a0-4e37-baae-19f02c6997be@redhat.com> (raw)
In-Reply-To: <20575f0a-656e-4bb3-9d82-dec6c7e3a35c@kernel.dk>

Hi Jens,

this patch introduced regression to locked SED OPAL2 devices. The locked 
region no longer returns -EIO upon IO. On read the caller receives block 
of zeroes, on write it does not report any error either. In both cases, 
previous to this patch, the caller would get IO error (expected) with 
locked device.

It was discovered by cryptsetup testsuite specifically 
https://gitlab.com/cryptsetup/cryptsetup/-/blob/main/tests/compat-test-opal

I've attached a simple patch that changes the ioerror condition and it 
fixed the problem with SED OPAL2 devices for me.

#regzbot introduced: 1f47ed294a2bd577d5ae43e6e28e1c9a3be4a833

With kind regards
O.

------

diff --git a/include/linux/blk-mq.h b/include/linux/blk-mq.h
index fa2a76cc2f73..b891ed113306 100644
--- a/include/linux/blk-mq.h
+++ b/include/linux/blk-mq.h
@@ -874,7 +874,7 @@ static inline bool blk_mq_add_to_batch(struct 
request *req,
   	if (!blk_rq_is_passthrough(req)) {
   		if (req->end_io)
   			return false;
-		if (ioerror < 0)
+		if (ioerror)
   			return false;
   	}



  parent reply	other threads:[~2025-02-28 11:59 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-13 15:18 [PATCH] block: cleanup and fix batch completion adding conditions Jens Axboe
2025-02-19  7:26 ` Shinichiro Kawasaki
2025-02-19 19:17   ` alan.adamson
2025-02-20  1:04     ` alan.adamson
2025-02-20  7:28       ` Shinichiro Kawasaki
2025-02-28 11:59 ` Ondrej Kozina [this message]
2025-02-28 14:08   ` Jens Axboe
2025-02-28 14:32     ` Ondrej Kozina
2025-03-04  9:25       ` Milan Broz
2025-03-11  3:03         ` Shinichiro Kawasaki
2025-03-11 14:59           ` Milan Broz
2025-03-11 15:00             ` Jens Axboe
2025-03-19 18:54               ` Milan Broz
2025-03-12 11:17           ` Ondrej Kozina

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=71bbd596-a3a0-4e37-baae-19f02c6997be@redhat.com \
    --to=okozina@redhat.com \
    --cc=axboe@kernel.dk \
    --cc=gmazyland@gmail.com \
    --cc=linux-block@vger.kernel.org \
    --cc=regressions@lists.linux.dev \
    /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