From: Damien Le Moal <dlemoal@kernel.org>
To: Jens Axboe <axboe@kernel.dk>,
linux-block@vger.kernel.org, Christoph Hellwig <hch@lst.de>,
linux-scsi@vger.kernel.org,
"Martin K . Petersen" <martin.petersen@oracle.com>
Subject: [PATCH v11 07/13] zloop: fix zone reporting consistency
Date: Tue, 17 Nov 2026 06:36:56 +0900 [thread overview]
Message-ID: <20261116213702.225970-8-dlemoal@kernel.org> (raw)
In-Reply-To: <20261116213702.225970-1-dlemoal@kernel.org>
In zloop_report_zones(), filling the write pointer and condition of a zone
descriptor separately outside of the zone wp_lock can lead to an
inconsistent zone report with a write pointer potentially not being
consistent with the condition being reported. Avoid such inconsistency by
filling both fields while holding the zone wp_lock.
Fixes: fcc6eaa3a03a ("zloop: introduce the ordered_zone_append configuration parameter")
Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
Reviewed-by: Hannes Reinecke <hare@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
---
drivers/block/zloop.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/block/zloop.c b/drivers/block/zloop.c
index 19949ed3824f..6bb68022ab30 100644
--- a/drivers/block/zloop.c
+++ b/drivers/block/zloop.c
@@ -950,8 +950,8 @@ static int zloop_report_zones(struct gendisk *disk, sector_t sector,
blkz.len = zlo->zone_size;
spin_lock(&zone->wp_lock);
blkz.wp = zone->wp;
- spin_unlock(&zone->wp_lock);
blkz.cond = zone->cond;
+ spin_unlock(&zone->wp_lock);
if (test_bit(ZLOOP_ZONE_CONV, &zone->flags)) {
blkz.type = BLK_ZONE_TYPE_CONVENTIONAL;
blkz.capacity = zlo->zone_size;
--
2.56.1
next prev parent reply other threads:[~2026-11-16 21:37 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-16 21:36 [PATCH v11 00/13] Add support for storage element depopulation Damien Le Moal
2026-11-16 21:36 ` [PATCH v11 01/13] block: introduce disk_zone_is_offline() Damien Le Moal
2026-11-16 21:36 ` [PATCH v11 02/13] block: refactor blk_revalidate_disk_zones() Damien Le Moal
2026-11-16 21:36 ` [PATCH v11 03/13] block: allow dropping all zone write plugs on revalidation Damien Le Moal
2026-11-16 21:36 ` [PATCH v11 04/13] block: introduce storage element management Damien Le Moal
2026-11-16 21:36 ` [PATCH v11 05/13] block: add storage element management ioctls Damien Le Moal
2026-11-16 21:36 ` [PATCH v11 06/13] zloop: fix ordered zone append handling Damien Le Moal
2026-11-16 21:36 ` Damien Le Moal [this message]
2026-11-16 21:36 ` [PATCH v11 08/13] zloop: add storage element emulation Damien Le Moal
2026-11-16 21:59 ` sashiko-bot
2026-11-16 21:36 ` [PATCH v11 09/13] zloop: add degrade_element control command Damien Le Moal
2026-11-16 21:44 ` sashiko-bot
2026-11-16 21:36 ` [PATCH v11 10/13] scsi: scsi_proto: refine the definition of storage element health Damien Le Moal
2026-11-16 21:37 ` [PATCH v11 11/13] scsi: sd_zbc: always revalidate zones for disks supporting head depopulation Damien Le Moal
2026-11-16 21:37 ` [PATCH v11 12/13] scsi: sd_zbc: define storage element management operations Damien Le Moal
2026-11-16 21:52 ` sashiko-bot
2026-11-16 21:37 ` [PATCH v11 13/13] scsi: sd: fail read commands to offline zones early 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=20261116213702.225970-8-dlemoal@kernel.org \
--to=dlemoal@kernel.org \
--cc=axboe@kernel.dk \
--cc=hch@lst.de \
--cc=linux-block@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
/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