nvme: avoid creating multipath sysfs group under namespace path devices
authorNilay Shroff <nilay@linux.ibm.com>
Wed, 21 May 2025 12:41:23 +0000 (18:11 +0530)
committerChristoph Hellwig <hch@lst.de>
Wed, 21 May 2025 12:55:46 +0000 (14:55 +0200)
commit49b9f86a594a5403641e6e60508788a7310fd293
tree5276968b245c401c23bf37fb786c0cfd8f5fc44c
parent355341e4359b2d5edf0ed5e117f7e9e7a0a5dac0
nvme: avoid creating multipath sysfs group under namespace path devices

Commit 4dbd2b2ebe4c ("nvme-multipath: Add visibility for round-robin
io-policy") introduced the creation of the multipath sysfs group under
the NVMe head gendisk device node. However, it also inadvertently added
the same sysfs group under each namespace path device which head node
refers to and that is incorrect.

The multipath sysfs group should only be exposed through the namespace
head gendisk node. This is sufficient, as the head device already
provides symbolic links to the individual namespace paths it manages.

This patch fixes the issue by preventing the creation of the multipath
sysfs group under namespace path devices, ensuring it only appears under
the head disk node.

Fixes: 4dbd2b2ebe4c ("nvme-multipath: Add visibility for round-robin io-policy")
Signed-off-by: Nilay Shroff <nilay@linux.ibm.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/nvme/host/sysfs.c