• I
    rbd: fix and simplify rbd_ioctl_set_ro() · 1de797bb
    Ilya Dryomov 提交于
    ->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: NIlya Dryomov <idryomov@gmail.com>
    1de797bb
rbd.c 166.0 KB