]> git.baikalelectronics.ru Git - kernel.git/commit
nvme: fix incorrect behavior when BLKROSET is called by the user
authorSagi Grimberg <sagi@grimberg.me>
Mon, 9 Nov 2020 10:57:34 +0000 (02:57 -0800)
committerChristoph Hellwig <hch@lst.de>
Mon, 9 Nov 2020 16:39:15 +0000 (17:39 +0100)
commit5b93f0943fbe0d527f65c6eab11f241723ab5272
treefeb2d7ce2260930cb8d297ec2e80bffbddd20024
parent1b091b4db542d7c8eaee53d59e2f83cce73eea4e
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: 8fbdc5733b44 ("nvme: set gendisk read only based on nsattr")
Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/nvme/host/core.c