linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Jens Axboe <axboe@kernel.dk>
Cc: Damien Le Moal <dlemoal@kernel.org>, linux-block@vger.kernel.org
Subject: [PATCH 3/2] block: don't return 1 for the fallback case in blkdev_get_zone_info
Date: Thu, 6 Nov 2025 15:53:32 +0100	[thread overview]
Message-ID: <20251106145332.GA15681@lst.de> (raw)

blkdev_do_report_zones returns the number of reported zones, but
blkdev_get_zone_info returns 0 or an errno.  Translate to the expected
return value in blkdev_report_zone_fallback.

Fixes: b037d41762fd ("block: introduce blkdev_get_zone_info()")
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 block/blk-zoned.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/block/blk-zoned.c b/block/blk-zoned.c
index c5226bcaaa94..8204214e3b89 100644
--- a/block/blk-zoned.c
+++ b/block/blk-zoned.c
@@ -895,8 +895,14 @@ static int blkdev_report_zone_fallback(struct block_device *bdev,
 		.data = zone,
 		.report_active = true,
 	};
+	int error;
 
-	return blkdev_do_report_zones(bdev, sector, 1, &args);
+	error = blkdev_do_report_zones(bdev, sector, 1, &args);
+	if (error < 0)
+		return error;
+	if (error == 0)
+		return -EIO;
+	return 0;
 }
 
 /*
-- 
2.47.3


             reply	other threads:[~2025-11-06 14:53 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-06 14:53 Christoph Hellwig [this message]
2025-11-07  6:14 ` [PATCH 3/2] block: don't return 1 for the fallback case in blkdev_get_zone_info Damien Le Moal
2025-11-07 11:37   ` Christoph Hellwig
2025-11-07 11:38 ` Jens Axboe

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=20251106145332.GA15681@lst.de \
    --to=hch@lst.de \
    --cc=axboe@kernel.dk \
    --cc=dlemoal@kernel.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;
as well as URLs for NNTP newsgroup(s).