aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/dm-thin-metadata.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2021-01-09 11:42:49 +0100
committerJens Axboe <axboe@kernel.dk>2021-01-24 18:15:57 -0700
commit1e0dcca9e1aa3caa1a0dc4300db1a091078fe40b (patch)
tree41a7cef2f3c4f1bdca2b9d78092b9194e6d1b4eb /drivers/md/dm-thin-metadata.c
parentLinux 5.11-rc5 (diff)
downloadlinux-dev-1e0dcca9e1aa3caa1a0dc4300db1a091078fe40b.tar.xz
linux-dev-1e0dcca9e1aa3caa1a0dc4300db1a091078fe40b.zip
dm: use bdev_read_only to check if a device is read-only
dm-thin and dm-cache also work on partitions, so use the proper interface to check if the device is read-only. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Ming Lei <ming.lei@redhat.com> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/md/dm-thin-metadata.c')
-rw-r--r--drivers/md/dm-thin-metadata.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/md/dm-thin-metadata.c b/drivers/md/dm-thin-metadata.c
index 6ebb2127f3e2..e75b20480e46 100644
--- a/drivers/md/dm-thin-metadata.c
+++ b/drivers/md/dm-thin-metadata.c
@@ -636,7 +636,7 @@ static int __check_incompat_features(struct thin_disk_superblock *disk_super,
/*
* Check for read-only metadata to skip the following RDWR checks.
*/
- if (get_disk_ro(pmd->bdev->bd_disk))
+ if (bdev_read_only(pmd->bdev))
return 0;
features = le32_to_cpu(disk_super->compat_ro_flags) & ~THIN_FEATURE_COMPAT_RO_SUPP;