Since kernel 5.12, hardware read-only state and user read-only
policy (BLKROGET/SET ioctls) are tracked separately in the block
layer. As the purpose of our ->set_read_only() method was exactly
that, it was removed.
As a side effect, BLKROSET no longer returns EROFS on an attempt
to make a read-only mapping read-write with "blockdev --setrw".
The policy gets updated, but the device remains read-only as before
because the hardware (== mapping) state is controlled by the driver.
Fixes: https://tracker.ceph.com/issues/49858
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
ceph-csi has added support for passing custom map and unmap options via
mapOptions and unmapOptions storage class parameters. However, it also
uses --read-only for implementing ROX (ReadOnlyMany) PVs. If the user
supplies "mapOptions: rw", they will get around the intended read-only
restriction (at least on the block device).
ceph-csi could be patched to use "-o ro", but it actually makes sense
for common options to win over device type-specific equivalents.
Fixes: https://tracker.ceph.com/issues/47625
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
"rbd snap create" now reports progress. Pass --no-progress, as in
commit b5a5fea9e2 ("test/cli-integration/rbd: tweak after snap create
started to show progress").
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
If an image is mapped read-only, setting its partition(s) to read-write
via BLKROSET is no longer allowed.
Add read-only OSD caps test cases.
Fixes: https://tracker.ceph.com/issues/42915
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
The block layer used to not enforce ioctl(BLKROSET) and set_disk_ro().
This has been fixed in 4.16-rc1.
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>