[PATCH] nvme: revert commit 1293477f4f32 as it is breaking BLKROSET

Sagi Grimberg sagi at grimberg.me
Fri Nov 6 12:18:35 EST 2020


The offending commit breaks BLKROSET ioctl because a device
revalidation will blindly override BLKROSET setting.

The author should resubmit this commit in a way that does
not break BLKROSET.

Fixes: 1293477f4f32 ("nvme: set gendisk read only based on nsattr")
Signed-off-by: Sagi Grimberg <sagi at grimberg.me>
---
 drivers/nvme/host/core.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index 40ca71b29bb9..f5365672ca82 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -2057,11 +2057,6 @@ static void nvme_update_disk_info(struct gendisk *disk,
 
 	nvme_config_discard(disk, ns);
 	nvme_config_write_zeroes(disk, ns);
-
-	if (id->nsattr & NVME_NS_ATTR_RO)
-		set_disk_ro(disk, true);
-	else
-		set_disk_ro(disk, false);
 }
 
 static inline bool nvme_first_scan(struct gendisk *disk)
-- 
2.25.1




More information about the Linux-nvme mailing list