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 <[email protected]> Cc: Max Gurtovoy <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Signed-off-by: Keith Busch <[email protected]>
1 parent c917dd9 commit 1c606f7

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

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)