Message ID | 20201208162829.2424563-5-hch@lst.de |
---|---|
State | Superseded |
Headers | show |
Series | [1/6] dm: use bdev_read_only to check if a device is read-only | expand |
diff --git a/block/genhd.c b/block/genhd.c index d9f989c1514123..6e51ecb9280aca 100644 --- a/block/genhd.c +++ b/block/genhd.c @@ -1656,8 +1656,7 @@ EXPORT_SYMBOL(set_disk_ro); int bdev_read_only(struct block_device *bdev) { - return bdev->bd_read_only || - test_bit(GD_READ_ONLY, &bdev->bd_disk->state); + return bdev->bd_read_only || get_disk_ro(bdev->bd_disk); } EXPORT_SYMBOL(bdev_read_only);