aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/loop.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2020-11-03 11:00:16 +0100
committerJens Axboe <axboe@kernel.dk>2020-11-16 08:14:29 -0700
commit7a2f0ce19f2e2ed93b5ace60375b908392ec8afb (patch)
treeddc33d08fea0908339cfa45cfe15a862dfc1589f /drivers/block/loop.c
parent732e12d805a77f74c907c0a28ece271ef1e81e01 (diff)
downloadlinux-7a2f0ce19f2e2ed93b5ace60375b908392ec8afb.tar.gz
loop: use set_disk_ro
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> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/block/loop.c')
-rw-r--r--drivers/block/loop.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/block/loop.c b/drivers/block/loop.c
index a58084c2ed7ceb..027f5724fe2c46 100644
--- a/drivers/block/loop.c
+++ b/drivers/block/loop.c
@@ -1138,7 +1138,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;