Skip to contentSkip to conversation

nvme: forward port sysfs delete fix

PATCH In review Keith Busch 2 participants 2 messages Jun 15, 2023 – Jun 16, 2023 NVMe

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nvme: forward port sysfs delete fix

From: Keith Busch <[email protected]>

We had a late fix that modified nvme_sysfs_delete() after the staging branch for the next merge window relocated the function to a new file. Port commit 2eb94dd56a4a4 ("nvme: do not let the user delete a ctrl before a complete") to the latest to avoid a potentially confusing merge conflict.

Cc Maurizio Lombardi <[email protected]>
Cc Max Gurtovoy <[email protected]>
---
 drivers/nvme/host/sysfs.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/nvme/host/sysfs.c +3 -0
index 796e1d373b7c1..45e91811f905c 100644
@@ -202,6 +202,9 @@ static ssize_t nvme_sysfs_delete(struct device *dev,
 {
 	struct nvme_ctrl *ctrl = dev_get_drvdata(dev);
 
+	if (!test_bit(NVME_CTRL_STARTED_ONCE, &ctrl->flags))
+		return -EBUSY;
+
 	if (device_remove_file_self(dev, attr))
 		nvme_delete_ctrl_sync(ctrl);
 	return count;
Signature · 1 line
2.34.1
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Keith Busch

From: Keith Busch <[email protected]>

We had a late fix that modified nvme_sysfs_delete() after the staging branch for the next merge window relocated the function to a new file. Port commit 2eb94dd56a4a4 ("nvme: do not let the user delete a ctrl before a complete") to the latest to avoid a potentially confusing merge conflict.

Looks good: