diff --git a/block/genhd.c b/block/genhd.c index 1873e4571328..ca5d880af512 100644 --- a/block/genhd.c +++ b/block/genhd.c @@ -1661,8 +1661,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);