Commit Graph

6 Commits

Author SHA1 Message Date
Ilya Dryomov
d72fca26ed qa: krbd_blkroset.t: update for separate hw and user read-only flags
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>
2021-03-17 11:00:33 +01:00
Ilya Dryomov
a107c47360 rbd: make common options override krbd-specific options
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>
2020-09-24 10:50:24 +02:00
Ilya Dryomov
f8a9880cbb qa: update krbd tests for snap create
"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>
2020-08-12 17:49:00 +02:00
Ilya Dryomov
366a369c8d qa: krbd_blkroset.t: update for read-only changes
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>
2019-11-20 19:53:23 +01:00
Ilya Dryomov
153af6b90a qa: krbd_blkroset.t: attempt discards in addition to writes
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>
2018-02-20 15:54:41 +01:00
Ilya Dryomov
2275381286 qa/suites/krbd: add krbd BLKROSET test
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
2017-10-31 13:40:16 +01:00