All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Jens Axboe <axboe@kernel.dk>
Cc: "Martin K . Petersen" <martin.petersen@oracle.com>,
	Oleksii Kurochko <olkuroch@cisco.com>,
	Sagi Grimberg <sagi@grimberg.me>,
	Mike Snitzer <snitzer@redhat.com>,
	Ilya Dryomov <idryomov@gmail.com>,
	Dongsheng Yang <dongsheng.yang@easystack.cn>,
	ceph-devel@vger.kernel.org, dm-devel@redhat.com,
	linux-block@vger.kernel.org, linux-nvme@lists.infradead.org,
	Ming Lei <ming.lei@redhat.com>, Hannes Reinecke <hare@suse.de>
Subject: [PATCH 1/6] dm: use bdev_read_only to check if a device is read-only
Date: Sat,  9 Jan 2021 11:42:49 +0100	[thread overview]
Message-ID: <20210109104254.1077093-2-hch@lst.de> (raw)
In-Reply-To: <20210109104254.1077093-1-hch@lst.de>

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>
---
 drivers/md/dm-cache-metadata.c | 2 +-
 drivers/md/dm-thin-metadata.c  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/md/dm-cache-metadata.c b/drivers/md/dm-cache-metadata.c
index af6d4f898e4c1d..89a73204dbf47f 100644
--- a/drivers/md/dm-cache-metadata.c
+++ b/drivers/md/dm-cache-metadata.c
@@ -449,7 +449,7 @@ static int __check_incompat_features(struct cache_disk_superblock *disk_super,
 	/*
 	 * Check for read-only metadata to skip the following RDWR checks.
 	 */
-	if (get_disk_ro(cmd->bdev->bd_disk))
+	if (bdev_read_only(cmd->bdev))
 		return 0;
 
 	features = le32_to_cpu(disk_super->compat_ro_flags) & ~DM_CACHE_FEATURE_COMPAT_RO_SUPP;
diff --git a/drivers/md/dm-thin-metadata.c b/drivers/md/dm-thin-metadata.c
index 6ebb2127f3e2e0..e75b20480e460e 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;
-- 
2.29.2


WARNING: multiple messages have this Message-ID (diff)
From: Christoph Hellwig <hch@lst.de>
To: Jens Axboe <axboe@kernel.dk>
Cc: Sagi Grimberg <sagi@grimberg.me>,
	Mike Snitzer <snitzer@redhat.com>,
	Oleksii Kurochko <olkuroch@cisco.com>,
	Dongsheng Yang <dongsheng.yang@easystack.cn>,
	Ming Lei <ming.lei@redhat.com>,
	linux-block@vger.kernel.org, dm-devel@redhat.com,
	linux-nvme@lists.infradead.org,
	"Martin K . Petersen" <martin.petersen@oracle.com>,
	Ilya Dryomov <idryomov@gmail.com>,
	ceph-devel@vger.kernel.org, Hannes Reinecke <hare@suse.de>
Subject: [PATCH 1/6] dm: use bdev_read_only to check if a device is read-only
Date: Sat,  9 Jan 2021 11:42:49 +0100	[thread overview]
Message-ID: <20210109104254.1077093-2-hch@lst.de> (raw)
In-Reply-To: <20210109104254.1077093-1-hch@lst.de>

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>
---
 drivers/md/dm-cache-metadata.c | 2 +-
 drivers/md/dm-thin-metadata.c  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/md/dm-cache-metadata.c b/drivers/md/dm-cache-metadata.c
index af6d4f898e4c1d..89a73204dbf47f 100644
--- a/drivers/md/dm-cache-metadata.c
+++ b/drivers/md/dm-cache-metadata.c
@@ -449,7 +449,7 @@ static int __check_incompat_features(struct cache_disk_superblock *disk_super,
 	/*
 	 * Check for read-only metadata to skip the following RDWR checks.
 	 */
-	if (get_disk_ro(cmd->bdev->bd_disk))
+	if (bdev_read_only(cmd->bdev))
 		return 0;
 
 	features = le32_to_cpu(disk_super->compat_ro_flags) & ~DM_CACHE_FEATURE_COMPAT_RO_SUPP;
diff --git a/drivers/md/dm-thin-metadata.c b/drivers/md/dm-thin-metadata.c
index 6ebb2127f3e2e0..e75b20480e460e 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;
-- 
2.29.2


_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

WARNING: multiple messages have this Message-ID (diff)
From: Christoph Hellwig <hch@lst.de>
To: Jens Axboe <axboe@kernel.dk>
Cc: Sagi Grimberg <sagi@grimberg.me>,
	Mike Snitzer <snitzer@redhat.com>,
	Oleksii Kurochko <olkuroch@cisco.com>,
	Dongsheng Yang <dongsheng.yang@easystack.cn>,
	Ming Lei <ming.lei@redhat.com>,
	linux-block@vger.kernel.org, dm-devel@redhat.com,
	linux-nvme@lists.infradead.org,
	"Martin K . Petersen" <martin.petersen@oracle.com>,
	Ilya Dryomov <idryomov@gmail.com>,
	ceph-devel@vger.kernel.org
Subject: [dm-devel] [PATCH 1/6] dm: use bdev_read_only to check if a device is read-only
Date: Sat,  9 Jan 2021 11:42:49 +0100	[thread overview]
Message-ID: <20210109104254.1077093-2-hch@lst.de> (raw)
In-Reply-To: <20210109104254.1077093-1-hch@lst.de>

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>
---
 drivers/md/dm-cache-metadata.c | 2 +-
 drivers/md/dm-thin-metadata.c  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/md/dm-cache-metadata.c b/drivers/md/dm-cache-metadata.c
index af6d4f898e4c1d..89a73204dbf47f 100644
--- a/drivers/md/dm-cache-metadata.c
+++ b/drivers/md/dm-cache-metadata.c
@@ -449,7 +449,7 @@ static int __check_incompat_features(struct cache_disk_superblock *disk_super,
 	/*
 	 * Check for read-only metadata to skip the following RDWR checks.
 	 */
-	if (get_disk_ro(cmd->bdev->bd_disk))
+	if (bdev_read_only(cmd->bdev))
 		return 0;
 
 	features = le32_to_cpu(disk_super->compat_ro_flags) & ~DM_CACHE_FEATURE_COMPAT_RO_SUPP;
diff --git a/drivers/md/dm-thin-metadata.c b/drivers/md/dm-thin-metadata.c
index 6ebb2127f3e2e0..e75b20480e460e 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;
-- 
2.29.2

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel


  reply	other threads:[~2021-01-09 10:46 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-09 10:42 split hard read-only vs read-only policy v3 (resend) Christoph Hellwig
2021-01-09 10:42 ` [dm-devel] " Christoph Hellwig
2021-01-09 10:42 ` Christoph Hellwig
2021-01-09 10:42 ` Christoph Hellwig [this message]
2021-01-09 10:42   ` [dm-devel] [PATCH 1/6] dm: use bdev_read_only to check if a device is read-only Christoph Hellwig
2021-01-09 10:42   ` Christoph Hellwig
2021-01-09 10:42 ` [PATCH 2/6] block: remove the NULL bdev check in bdev_read_only Christoph Hellwig
2021-01-09 10:42   ` [dm-devel] " Christoph Hellwig
2021-01-09 10:42   ` Christoph Hellwig
2021-01-09 20:14   ` Chaitanya Kulkarni
2021-01-09 20:14     ` [dm-devel] " Chaitanya Kulkarni
2021-01-09 20:14     ` Chaitanya Kulkarni
2021-01-10 14:59   ` Hannes Reinecke
2021-01-10 14:59     ` [dm-devel] " Hannes Reinecke
2021-01-10 14:59     ` Hannes Reinecke
2021-01-09 10:42 ` [PATCH 3/6] block: add a hard-readonly flag to struct gendisk Christoph Hellwig
2021-01-09 10:42   ` [dm-devel] " Christoph Hellwig
2021-01-09 10:42   ` Christoph Hellwig
2021-01-09 10:42 ` [PATCH 4/6] block: propagate BLKROSET on the whole device to all partitions Christoph Hellwig
2021-01-09 10:42   ` [dm-devel] " Christoph Hellwig
2021-01-09 10:42   ` Christoph Hellwig
2021-01-10 15:00   ` Hannes Reinecke
2021-01-10 15:00     ` [dm-devel] " Hannes Reinecke
2021-01-10 15:00     ` Hannes Reinecke
2021-01-09 10:42 ` [PATCH 5/6] rbd: remove the ->set_read_only method Christoph Hellwig
2021-01-09 10:42   ` [dm-devel] " Christoph Hellwig
2021-01-09 10:42   ` Christoph Hellwig
2021-01-09 10:42 ` [PATCH 6/6] nvme: allow revalidate to set a namespace read-only Christoph Hellwig
2021-01-09 10:42   ` [dm-devel] " Christoph Hellwig
2021-01-09 10:42   ` Christoph Hellwig
2021-01-09 20:27   ` Chaitanya Kulkarni
2021-01-09 20:27     ` [dm-devel] " Chaitanya Kulkarni
2021-01-09 20:27     ` Chaitanya Kulkarni
2021-01-10 15:01   ` Hannes Reinecke
2021-01-10 15:01     ` [dm-devel] " Hannes Reinecke
2021-01-10 15:01     ` Hannes Reinecke
  -- strict thread matches above, loose matches on Subject: below --
2020-12-08 16:28 split hard read-only vs read-only policy v3 Christoph Hellwig
2020-12-08 16:28 ` [PATCH 1/6] dm: use bdev_read_only to check if a device is read-only Christoph Hellwig
2020-12-08 16:28   ` Christoph Hellwig
2020-12-07 13:19 split hard read-only vs read-only policy v2 Christoph Hellwig
2020-12-07 13:19 ` [PATCH 1/6] dm: use bdev_read_only to check if a device is read-only Christoph Hellwig
2020-12-07 13:19   ` Christoph Hellwig
2020-12-08  5:23   ` Martin K. Petersen
2020-12-08  5:23     ` Martin K. Petersen
2020-12-08  9:59   ` Ming Lei
2020-12-08  9:59     ` Ming Lei

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210109104254.1077093-2-hch@lst.de \
    --to=hch@lst.de \
    --cc=axboe@kernel.dk \
    --cc=ceph-devel@vger.kernel.org \
    --cc=dm-devel@redhat.com \
    --cc=dongsheng.yang@easystack.cn \
    --cc=hare@suse.de \
    --cc=idryomov@gmail.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=martin.petersen@oracle.com \
    --cc=ming.lei@redhat.com \
    --cc=olkuroch@cisco.com \
    --cc=sagi@grimberg.me \
    --cc=snitzer@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.