Skip to content

Commit

Permalink
nvme: forward port sysfs delete fix
Browse files Browse the repository at this point in the history
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 2eb94dd ("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>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Keith Busch <kbusch@kernel.org>
  • Loading branch information
Keith Busch committed Jun 16, 2023
1 parent c917dd9 commit 1c606f7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/nvme/host/sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 1c606f7

Please sign in to comment.