All of lore.kernel.org
 help / color / mirror / Atom feed
From: Damien Le Moal <dlemoal@kernel.org>
To: Mark Bundschuh <mkbund@amazon.com>,
	Alasdair Kergon <agk@redhat.com>,
	Mike Snitzer <snitzer@kernel.org>,
	Mikulas Patocka <mpatocka@redhat.com>,
	Benjamin Marzinski <bmarzins@redhat.com>
Cc: dm-devel@lists.linux.dev, linux-block@vger.kernel.org,
	linux-kernel@vger.kernel.org, Christoph Hellwig <hch@lst.de>,
	stable@vger.kernel.org
Subject: Re: [PATCH] dm: fix infinite loop in dm_blk_do_report_zones()
Date: Thu, 22 Oct 2026 09:57:58 +0200	[thread overview]
Message-ID: <ff60b44b-e85d-433e-9c08-450474c7af09@kernel.org> (raw)
In-Reply-To: <20261019192819.3962873-1-mkbund@amazon.com>

On 2026/10/19 21:28, Mark Bundschuh wrote:
> If the device underlying a zoned target is removed, its capacity is set
> to 0 and blkdev_report_zones() returns 0 without reporting any zones.
> The mapped device keeps its old capacity, so args->zone_idx and
> args->next_sector never advance and dm_blk_do_report_zones() loops
> forever. On non-preemptible kernels this causes soft lockups and RCU
> stalls.
> 
> The following sequence of commands triggers the hang:
> 
> modprobe scsi_debug zbc=managed dev_size_mb=1024 zone_size_mb=64
> udevadm settle
> echo '0 2097152 linear /dev/sda 0' | dmsetup create lin
> echo 1 > /sys/block/sda/device/delete
> blkzone report -o 0 -c 1 /dev/mapper/lin
> 
> Fix this by returning -EIO when a target reports no zones. The target
> always maps args->next_sector, so a zero return means the underlying
> device no longer covers that sector.
> 
> Fixes: d41003513e61 ("block: rework zone reporting")
> Cc: stable@vger.kernel.org
> Signed-off-by: Mark Bundschuh <mkbund@amazon.com>

Looks good.

Reviewed-by: Damien Le Moal <dlemoal@kernel.org>

-- 
Damien Le Moal
Western Digital Research

      reply	other threads:[~2026-10-22  7:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-19 19:28 [PATCH] dm: fix infinite loop in dm_blk_do_report_zones() Mark Bundschuh
2026-10-22  7:57 ` Damien Le Moal [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=ff60b44b-e85d-433e-9c08-450474c7af09@kernel.org \
    --to=dlemoal@kernel.org \
    --cc=agk@redhat.com \
    --cc=bmarzins@redhat.com \
    --cc=dm-devel@lists.linux.dev \
    --cc=hch@lst.de \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mkbund@amazon.com \
    --cc=mpatocka@redhat.com \
    --cc=snitzer@kernel.org \
    --cc=stable@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 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.