From: Sasha Levin <sashal@kernel.org>
To: stable@vger.kernel.org
Cc: Sasha Levin <sashal@kernel.org>,
gregkh@linuxfoundation.org, bvanassche@acm.org,
hulianqin@vivo.com, Yi Xu <xuyi0562@gmail.com>
Subject: Re: [PATCH 5.10.y] scsi: sd: Mark the disk dead if runtime resume fails in sd_remove()
Date: Tue, 24 Nov 2026 09:50:54 -0500 [thread overview]
Message-ID: <2026-11-24-1-daily-reply-0003@kernel.org> (raw)
In-Reply-To: <20261124032722.102378-1-xuyi0562@gmail.com>
> [ Upstream commit 085bb18a0b91007f04ddca13af30277c78040157 ]
This is only in 7.3 so far. 6.18, 6.12, 6.6, 6.1 and 5.15 need it
before 5.10 can take it, so please send backports for those trees too.
On 6.18 through 6.1 it is only a context adjustment in sd_remove(),
which still has the old "static int sd_remove(struct device *dev)" form.
5.15 also needs 7e9a46004b47 ("block: set QUEUE_FLAG_DYING unconditionally in
blk_mark_disk_dead()") first. Without it, blk_mark_disk_dead() there does not
set QUEUE_FLAG_DYING and del_gendisk() leaves the queue frozen, so
sd_shutdown() can block forever in blk_queue_enter() when the autopm get fails
on a still-active device.
> [The upstream fix calls blk_mark_disk_dead(), introduced by
> commit 6f8191fdf41d ("block: simplify disk shutdown"). That
blk_mark_disk_dead() was added by 7a5428dcb790 ("block: fix surprise
removal for drivers calling blk_set_queue_dying"), not 6f8191fdf41d.
> blk_queue_enter() (the counterpart of the upstream
> __bio_queue_enter()) releases waiters on QUEUE_FLAG_DYING, and
> del_gendisk() itself marks the queue dying later via
> blk_unregister_queue(); this fix only moves that point ahead of
On 5.10 del_gendisk() does not mark the queue dying through
blk_unregister_queue(). That happens in blk_cleanup_queue() from
__scsi_remove_device(), after sd_remove() returns.
> The fix builds cleanly on v5.10.274.
Did you reproduce the hang on 5.10 and test the fix there, or only
build it?
Please send a v3.
--
Thanks,
Sasha
prev parent reply other threads:[~2026-11-24 14:51 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-23 9:45 [PATCH] [ Upstream commit 085bb18a0b91007f04ddca13af30277c78040157 ] Yi Xu
2026-11-23 12:16 ` Greg KH
2026-11-24 3:27 ` [PATCH 5.10.y] scsi: sd: Mark the disk dead if runtime resume fails in sd_remove() Yi Xu
2026-11-24 14:50 ` Sasha Levin [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=2026-11-24-1-daily-reply-0003@kernel.org \
--to=sashal@kernel.org \
--cc=bvanassche@acm.org \
--cc=gregkh@linuxfoundation.org \
--cc=hulianqin@vivo.com \
--cc=stable@vger.kernel.org \
--cc=xuyi0562@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