Skip to content

Commit 1c606f7

Browse files
committed
nvme: forward port sysfs delete fix
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>
1 parent c917dd9 commit 1c606f7

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

drivers/nvme/host/sysfs.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,9 @@ static ssize_t nvme_sysfs_delete(struct device *dev,
202202
{
203203
struct nvme_ctrl *ctrl = dev_get_drvdata(dev);
204204

205+
if (!test_bit(NVME_CTRL_STARTED_ONCE, &ctrl->flags))
206+
return -EBUSY;
207+
205208
if (device_remove_file_self(dev, attr))
206209
nvme_delete_ctrl_sync(ctrl);
207210
return count;

0 commit comments

Comments
 (0)