]> www.infradead.org Git - users/hch/block.git/commitdiff
loop: use set_disk_ro
authorChristoph Hellwig <hch@lst.de>
Thu, 29 Oct 2020 11:24:01 +0000 (12:24 +0100)
committerChristoph Hellwig <hch@lst.de>
Tue, 3 Nov 2020 09:33:31 +0000 (10:33 +0100)
Use set_disk_ro instead of set_device_ro to match all other block
drivers and to ensure all partitions mirror the read-only flag.

Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/block/loop.c

index cb1191d6e945f27bd1c5582321cd6ef5496727bf..3e1ea45bb315d8c50c85b7eec3e594edb2701659 100644 (file)
@@ -1137,7 +1137,7 @@ static int loop_configure(struct loop_device *lo, fmode_t mode,
        if (error)
                goto out_unlock;
 
-       set_device_ro(bdev, (lo->lo_flags & LO_FLAGS_READ_ONLY) != 0);
+       set_disk_ro(lo->lo_disk, (lo->lo_flags & LO_FLAGS_READ_ONLY) != 0);
 
        lo->use_dio = lo->lo_flags & LO_FLAGS_DIRECT_IO;
        lo->lo_device = bdev;