nvme: fix incorrect behavior when BLKROSET is called by the user
Sagi Grimberg
maintainerPATCH v2 1/1 nvme: fix incorrect behavior when BLKROSET is called by the user
The offending commit breaks BLKROSET ioctl because a device revalidation will blindly override BLKROSET setting. Hence, we remove the disk rw setting in case NVME_NS_ATTR_RO is cleared from by the controller.
Fixes 1293477f4f32 ("nvme: set gendisk read only based on nsattr")
Signed-off-by Sagi Grimberg <[email protected]>
---
From v1:
- keep the ro set, remove only ro clear
drivers/nvme/host/core.c | 2 -- 1 file changed, 2 deletions(-)
drivers/nvme/host/core.c +0 -2
@@ -2060,8 +2060,6 @@ static void nvme_update_disk_info(struct gendisk *disk,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)
Signature · 7 lines
2.25.1 _______________________________________________ Linux-nvme mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-nvme
Thanks,
applied to nvme-5.10.
_______________________________________________
Linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme