]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
rbd: fix and simplify rbd_ioctl_set_ro()
authorIlya Dryomov <idryomov@gmail.com>
Thu, 12 Oct 2017 10:35:19 +0000 (12:35 +0200)
committerIlya Dryomov <idryomov@gmail.com>
Mon, 13 Nov 2017 11:11:41 +0000 (12:11 +0100)
commit1de797bb248d2276337139fecaffbd3bbc0f736d
treec8ee0b09435866327547ce07b5603346588e079a
parentbb0581f01c38ff525295fc6128bc3a49202dabae
rbd: fix and simplify rbd_ioctl_set_ro()

->open_count/-EBUSY check is bogus and wrong: when an open device is
set read-only, blkdev_write_iter() refuses further writes with -EPERM.
This is standard behaviour and all other block devices allow this.

set_disk_ro() call is also problematic: we affect the entire device
when called on a single partition.

All rbd_ioctl_set_ro() needs to do is refuse ro -> rw transition for
mapped snapshots.  Everything else can be handled by generic code.

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
drivers/block/rbd.c