All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hannes Reinecke <hare@kernel.org>
To: Christoph Hellwig <hch@lst.de>
Cc: Sagi Grimberg <sagi@grimberg.me>, Keith Busch <kbusch@kernel.org>,
	linux-nvme@lists.infradead.org, Hannes Reinecke <hare@kernel.org>,
	Nilay Shroff <nilay@linux.ibm.com>
Subject: [PATCH] nvme-multipath: clear NVME_NS_SYSFS_ATTR_LINK when disk is not added
Date: Mon, 14 Apr 2025 14:25:45 +0200	[thread overview]
Message-ID: <20250414122545.140531-1-hare@kernel.org> (raw)

If the namespace disk is not added we need to clear NVME_NS_SYSFS_ATTR_LINK,
otherwise the link will never be created upon rescan.

Fixes: 4dbd2b2ebe4c ("nvme-multipath: Add visibility for round-robin io-policy")

Signed-off-by: Hannes Reinecke <hare@kernel.org>
Cc: Nilay Shroff <nilay@linux.ibm.com>
---
 drivers/nvme/host/multipath.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/nvme/host/multipath.c b/drivers/nvme/host/multipath.c
index 05eccd96d34a..5c28f0dc6fad 100644
--- a/drivers/nvme/host/multipath.c
+++ b/drivers/nvme/host/multipath.c
@@ -1069,8 +1069,10 @@ void nvme_mpath_add_sysfs_link(struct nvme_ns_head *head)
 		 * Ensure that ns path disk node is already added otherwise we
 		 * may get invalid kobj name for target
 		 */
-		if (!test_bit(GD_ADDED, &ns->disk->state))
+		if (!test_bit(GD_ADDED, &ns->disk->state)) {
+			clear_bit(NVME_NS_SYSFS_ATTR_LINK, &ns->flags);
 			continue;
+		}
 
 		target = disk_to_dev(ns->disk);
 		/*
-- 
2.35.3



             reply	other threads:[~2025-04-14 12:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-14 12:25 Hannes Reinecke [this message]
2025-04-14 20:32 ` [PATCH] nvme-multipath: clear NVME_NS_SYSFS_ATTR_LINK when disk is not added Sagi Grimberg
2025-04-15  6:06   ` Nilay Shroff

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=20250414122545.140531-1-hare@kernel.org \
    --to=hare@kernel.org \
    --cc=hch@lst.de \
    --cc=kbusch@kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=nilay@linux.ibm.com \
    --cc=sagi@grimberg.me \
    /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.