* [PATCH] nvme: forward port sysfs delete fix
@ 2023-06-15 15:23 Keith Busch
2023-06-16 7:16 ` Christoph Hellwig
0 siblings, 1 reply; 2+ messages in thread
From: Keith Busch @ 2023-06-15 15:23 UTC (permalink / raw)
To: linux-nvme, hch, sagi; +Cc: Keith Busch, Maurizio Lombardi, Max Gurtovoy
From: Keith Busch <kbusch@kernel.org>
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 <mlombard@redhat.com>
Cc: Max Gurtovoy <mgurtovoy@nvidia.com>
Signed-off-by: Keith Busch <kbusch@kernel.org>
---
drivers/nvme/host/sysfs.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/nvme/host/sysfs.c b/drivers/nvme/host/sysfs.c
index 796e1d373b7c1..45e91811f905c 100644
--- a/drivers/nvme/host/sysfs.c
+++ b/drivers/nvme/host/sysfs.c
@@ -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;
--
2.34.1
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] nvme: forward port sysfs delete fix
2023-06-15 15:23 [PATCH] nvme: forward port sysfs delete fix Keith Busch
@ 2023-06-16 7:16 ` Christoph Hellwig
0 siblings, 0 replies; 2+ messages in thread
From: Christoph Hellwig @ 2023-06-16 7:16 UTC (permalink / raw)
To: Keith Busch
Cc: linux-nvme, hch, sagi, Keith Busch, Maurizio Lombardi,
Max Gurtovoy
On Thu, Jun 15, 2023 at 08:23:18AM -0700, Keith Busch wrote:
> From: Keith Busch <kbusch@kernel.org>
>
> 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:
Reviewed-by: Christoph Hellwig <hch@lst.de>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-06-16 7:16 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-15 15:23 [PATCH] nvme: forward port sysfs delete fix Keith Busch
2023-06-16 7:16 ` Christoph Hellwig
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.