Skip to content

Commit 65c5a05

Browse files
sagigrimbergChristoph Hellwig
authored andcommitted
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: 1293477 ("nvme: set gendisk read only based on nsattr") Signed-off-by: Sagi Grimberg <sagi@grimberg.me> Signed-off-by: Christoph Hellwig <hch@lst.de>
1 parent e1777d0 commit 65c5a05

1 file changed

Lines changed: 0 additions & 2 deletions

File tree

drivers/nvme/host/core.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2060,8 +2060,6 @@ static void nvme_update_disk_info(struct gendisk *disk,
20602060

20612061
if (id->nsattr & NVME_NS_ATTR_RO)
20622062
set_disk_ro(disk, true);
2063-
else
2064-
set_disk_ro(disk, false);
20652063
}
20662064

20672065
static inline bool nvme_first_scan(struct gendisk *disk)

0 commit comments

Comments
 (0)