This is a note to let you know that I've just added the patch titled nvme: fix incorrect behavior when BLKROSET is called by the user to the 5.9-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: nvme-fix-incorrect-behavior-when-blkroset-is-called-.patch and it can be found in the queue-5.9 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. commit 60381785be6b6018ea4171a7a7757dc2460bd17b Author: Sagi Grimberg <sagi@xxxxxxxxxxx> Date: Mon Nov 9 02:57:34 2020 -0800 nvme: fix incorrect behavior when BLKROSET is called by the user [ Upstream commit 65c5a055b0d567b7e7639d942c0605da9cc54c5e ] 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 <sagi@xxxxxxxxxxx> Signed-off-by: Christoph Hellwig <hch@xxxxxx> Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx> diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index b130696b00592..349fba056cb65 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c @@ -2064,8 +2064,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)