mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: <shao.mingyin@zte.com.cn>
To: <tom.leiming@gmail.com>
Cc: <axboe@kernel.dk>, <linux-block@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] ublk: stop reporting zones on an empty response
Date: Tue, 10 Nov 2026 11:00:55 +0800 (CST)	[thread overview]
Message-ID: <20261110110055098II4wpWozLDjv3_Wa9W47C@zte.com.cn> (raw)
In-Reply-To: <avJzGIqp5ZUehCGx@fedora-laptop>

On Mon, Nov 09, 2026 at 07:27:52PM -0600, Ming Lei wrote:
> The issue is real, I can reproduce it with one ublk server which
> completes UBLK_IO_OP_REPORT_ZONES without filling any zone: both
> BLKREPORTZONE and START_DEV(blk_revalidate_disk_zones()) loop forever,
> and the task can't be killed.

Thanks for reproducing it against a real server.

> But this terminates the whole report on any zero-length zone, not only
> on an empty response.

You're right, that is a regression I introduced.  The zero-length entry
marks the end of this response, and the driver is supposed to ask for the
rest from the advanced sector.  The UAPI says as much: "nr_zones" is an
upper bound, and reporting fewer zones is done by zeroing the last entry.
For BLKREPORTZONE the truncation is silent too: the ioctl still returns 0
and just reports 128 of the 256 requested zones, while START_DEV fails in
the last-zone/capacity check.

> How about stopping only if the response doesn't carry any zone? That is
> what sd_zbc and virtio_blk do too.

Taking that shape.  v2 keeps the loop index outside the inner for and
stops the outer loop only when the response carried no zone at all, so a
short but non-empty response is still followed up as before.  I'll keep
the Fixes: and stable tags and add your Suggested-by.

v2 will follow as a separate thread.

Thanks,
Shao Mingyin

      reply	other threads:[~2026-11-10  3:01 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-09 14:51 shao.mingyin
2026-11-10  1:27 ` Ming Lei
2026-11-10  3:00   ` shao.mingyin [this message]

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=20261110110055098II4wpWozLDjv3_Wa9W47C@zte.com.cn \
    --to=shao.mingyin@zte.com.cn \
    --cc=axboe@kernel.dk \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tom.leiming@gmail.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

all inboxes | Powered by JetHome®