From: Christoph Hellwig hch@lst.de
mainline inclusion from mainline-v5.15-rc1 commit 916a470da02f909cabb65337f65438b8bc3965b2 category: bugfix bugzilla: https://gitee.com/src-openeuler/kernel/issues/IB67YI CVE: CVE-2024-53093
Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?i...
--------------------------------
Use the nvme-internal NVME_NSHEAD_DISK_LIVE flag instead of abusing the block layer state.
Signed-off-by: Christoph Hellwig hch@lst.de Link: https://lore.kernel.org/r/20210809064028.1198327-5-hch@lst.de Signed-off-by: Jens Axboe axboe@kernel.dk
Conflicts: drivers/nvme/host/multipath.c [Context inconsistency.] Signed-off-by: Zheng Qixing zhengqixing@huawei.com --- drivers/nvme/host/multipath.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/nvme/host/multipath.c b/drivers/nvme/host/multipath.c index 13e6d8b66790..7c14931bcf67 100644 --- a/drivers/nvme/host/multipath.c +++ b/drivers/nvme/host/multipath.c @@ -714,7 +714,7 @@ void nvme_mpath_shutdown_disk(struct nvme_ns_head *head) if (!head->disk) return; kblockd_schedule_work(&head->requeue_work); - if (head->disk->flags & GENHD_FL_UP) + if (test_bit(NVME_NSHEAD_DISK_LIVE, &head->flags)) del_gendisk(head->disk); }