On Sun, Nov 15, 2020 at 10:55:36PM -0500, Martin K. Petersen wrote: > My original patch separated "should-write-bios-be-rejected?" state from > "did-the-user-set-this-partition-ro?". In the rebased version a > full-device state transition in update_all_part_ro_state() blows away > any policy the user has set on a given partition. > > The blktests that fail are due to something like: > > # modprobe scsi_debug num_parts=2 > # blockdev --setro /dev/sda2 > # grep . /sys/block/sda/sda2/ro > 1 > # echo 1 > /sys/module/scsi_debug/parameters/wp > # echo 1 > /sys/block/sda/device/rescan > # echo 0 > /sys/module/scsi_debug/parameters/wp > # echo 1 > /sys/block/sda/device/rescan > # grep . /sys/block/sda/sda2/ro > 0 > > The user expectation is that since they set partition 2 readonly it > should remain that way until they either clear the flag or issue > BLKRRPART to cause the partition table to be reread. True. But then again I think the whole idea that a BLKROSET on the whole device has any effect on the partitions is probably a bad idea. Even more so once we have the proper hard ro flag in the disk. I think I'll respin without that.