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

Sagi Grimberg sagi at grimberg.me
Fri Nov 6 14:02:28 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.
> 
> Let's fix this properly instead of a blind revert.

I've asked Chaitanya to address this, but I guess he didn't
get to it so at the very least lets not keep the breakage.

>> -	if (id->nsattr & NVME_NS_ATTR_RO)
>> -		set_disk_ro(disk, true);
>> -	else
>> -		set_disk_ro(disk, false);
> 
> Just dropping the else part is probably enough for now, although
> as a follow on we should probably add a "hard read-only" state to
> the block layer.

Removing the else would have an incorrect behavior. I think its better
to not support it (until we support it correctly) than to support it
incorrectly.

Process-wise, I think we should revert this because it was added
incorrectly. Having a "hard-ro" in the block layer is unlikely to be
backported to stable. Hence I think we should revert it and re-add it
correctly this time.



More information about the Linux-nvme mailing list