]> www.infradead.org Git - nvme.git/commit
nvme-multipath: sysfs links may not be created for devices
authorHannes Reinecke <hare@kernel.org>
Tue, 15 Apr 2025 06:47:37 +0000 (08:47 +0200)
committerChristoph Hellwig <hch@lst.de>
Wed, 16 Apr 2025 05:37:36 +0000 (07:37 +0200)
commit08937bcd4cfe11405d80b35041c38cf4a4b046ed
tree1d68a50d616ab7b02ffca05171ea0c65a0ea8141
parent26d7fb4fd4ca1180e2fa96587dea544563b4962a
nvme-multipath: sysfs links may not be created for devices

When rapidly rescanning for new namespaces nvme_mpath_add_sysfs_link() may be
called for a block device not added to sysfs. But NVME_NS_SYSFS_ATTR_LINK
had already been set, so when checking this device a second time we will fail
to create the link.

Fix this by exchanging the order of the block device check and the
NVME_NS_SYSFS_ATTR_LINK bit check.

Fixes: 4dbd2b2ebe4c ("nvme-multipath: Add visibility for round-robin io-policy")
Signed-off-by: Hannes Reinecke <hare@kernel.org>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>**
Reviewed-by: Nilay Shroff <nilay@linux.ibm.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/nvme/host/multipath.c