From: Damien Le Moal <dlemoal@kernel.org>
To: linux-block@vger.kernel.org, Jens Axboe <axboe@kernel.dk>,
Mike Snitzer <snitzer@kernel.org>,
Mikulas Patocka <mpatocka@redhat.com>,
dm-devel@lists.linux.dev
Cc: Christoph Hellwig <hch@lst.de>, Bart Van Assche <bvanassche@acm.org>
Subject: [PATCH v2 2/4] block: Ignore REQ_NOWAIT for zone reset and zone finish operations
Date: Mon, 9 Dec 2024 07:57:56 +0900 [thread overview]
Message-ID: <20241208225758.219228-3-dlemoal@kernel.org> (raw)
In-Reply-To: <20241208225758.219228-1-dlemoal@kernel.org>
There are currently any issuer of REQ_OP_ZONE_RESET and
REQ_OP_ZONE_FINISH operations that set REQ_NOWAIT. However, as we cannot
handle this flag correctly due to the potential request allocation
failure that may happen in blk_mq_submit_bio() after blk_zone_plug_bio()
has handled the zone write plug write pointer updates for the targeted
zones, modify blk_zone_wplug_handle_reset_or_finish() to warn if this
flag is set and ignore it.
Fixes: dd291d77cc90 ("block: Introduce zone write plugging")
Cc: stable@vger.kernel.org
Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
---
block/blk-zoned.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/block/blk-zoned.c b/block/blk-zoned.c
index 7982b9494d63..ee9c67121c6c 100644
--- a/block/blk-zoned.c
+++ b/block/blk-zoned.c
@@ -707,6 +707,15 @@ static bool blk_zone_wplug_handle_reset_or_finish(struct bio *bio,
return true;
}
+ /*
+ * No-wait reset or finish BIOs do not make much sense as the callers
+ * issue these as blocking operations in most cases. To avoid issues
+ * the BIO execution potentially failing with BLK_STS_AGAIN, warn about
+ * REQ_NOWAIT being set and ignore that flag.
+ */
+ if (WARN_ON_ONCE(bio->bi_opf & REQ_NOWAIT))
+ bio->bi_opf &= ~REQ_NOWAIT;
+
/*
* If we have a zone write plug, set its write pointer offset to 0
* (reset case) or to the zone size (finish case). This will abort all
--
2.47.1
next prev parent reply other threads:[~2024-12-08 22:58 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-08 22:57 [PATCH v2 0/4] Zone write plugging fixes Damien Le Moal
2024-12-08 22:57 ` [PATCH v2 1/4] block: Use a zone write plug BIO work for REQ_NOWAIT BIOs Damien Le Moal
2024-12-09 7:44 ` Christoph Hellwig
2024-12-08 22:57 ` Damien Le Moal [this message]
2024-12-09 7:46 ` [PATCH v2 2/4] block: Ignore REQ_NOWAIT for zone reset and zone finish operations Christoph Hellwig
2024-12-08 22:57 ` [PATCH v2 3/4] block: Prevent potential deadlocks in zone write plug error recovery Damien Le Moal
2024-12-09 7:57 ` Christoph Hellwig
2024-12-09 8:18 ` Damien Le Moal
2024-12-09 8:21 ` Christoph Hellwig
2024-12-08 22:57 ` [PATCH v2 4/4] dm: Fix dm-zoned-reclaim zone write pointer alignment Damien Le Moal
2024-12-09 7:44 ` Christoph Hellwig
2024-12-09 8:38 ` Damien Le Moal
2024-12-09 8:39 ` Christoph Hellwig
2024-12-09 8:40 ` 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=20241208225758.219228-3-dlemoal@kernel.org \
--to=dlemoal@kernel.org \
--cc=axboe@kernel.dk \
--cc=bvanassche@acm.org \
--cc=dm-devel@lists.linux.dev \
--cc=hch@lst.de \
--cc=linux-block@vger.kernel.org \
--cc=mpatocka@redhat.com \
--cc=snitzer@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.