From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3DAE1C64E90 for ; Sun, 29 Nov 2020 18:19:57 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C9A1E20731 for ; Sun, 29 Nov 2020 18:19:56 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="YOfVqVuO"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="RNnJn233" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C9A1E20731 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-nvme-bounces+linux-nvme=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=KsYmR5GJav6cQAw4ae4c9UjMzO0gULBxzcXXHCkfZB8=; b=YOfVqVuO4l0bDH1fMle5szAnR 5EVw7qP8k/qdfZ6qGmV044t8JZXhiof7lgy6RjaNOoF7BzVdxr+hgsfZRlUw7iCM5P+WDwg+LobLc EE1TqlryMF0DJ2l6qdOa3Q91su1Xp8UEdK19tvvU3IdmY8Pz4AcUTFLkzx793pIrWrrs6qo1zUwln MYL/N6cGT+ZJGm178lrTMeP/mjC0BbBpnhVEgmPhD9hHZqMo2Ki5MFkfk/cSEM4OV2aBPaRsdtUQU xoQKFybY0pqO/pkGFPGfXHdRzWY9vYyptbRDAUxlMrJ941ZiJiLAYvICXxuEjDEBmScydGtMHcwxh hwhr2lFBw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kjRIg-0007Tg-2L; Sun, 29 Nov 2020 18:19:54 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kjRIa-0007SS-2J for linux-nvme@merlin.infradead.org; Sun, 29 Nov 2020 18:19:48 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=hYHfVN063JQbHTCkfynZwru10h0kXGt47OKm344U7QI=; b=RNnJn233VIIM9mljzx/z0CfeHt G7ucCDhvMQpp00m0IO2uRh5AJu7x3w8f94ZW0gJhL5j+HD6tI3vatePjdc8aLbpOL/IqpoqN1OnGZ ZgZSqoVRQwzLwXKt9OCHUOfTzJkrzh4sH4SXAQcpxYEXU9jnpY/rKKtPZOVBdmelGJM4hjpxcMR+y 773cKGqomZoQ/OD98M3I78XxAVdwQr6ebe33IX7CEok3fS3su5N5pGTcOasso+SEeE05Hxq/BLNIR XoyprCr5vtKtyPsk6uBYkfKDvUE84CfGXn+CUzhfUJIvZmn4bdsG6SrOmIjMdSV3KupxxPT2G2j1D zubdPLiw==; Received: from [2001:4bb8:18c:1dd6:f89e:6884:c966:3d6c] (helo=localhost) by casper.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1kjRIW-00078O-W2; Sun, 29 Nov 2020 18:19:46 +0000 From: Christoph Hellwig To: Jens Axboe Subject: [PATCH 4/4] dm: use bdev_read_only to check if a device is read-only Date: Sun, 29 Nov 2020 19:19:26 +0100 Message-Id: <20201129181926.897775-5-hch@lst.de> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201129181926.897775-1-hch@lst.de> References: <20201129181926.897775-1-hch@lst.de> MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html X-BeenThere: linux-nvme@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sagi Grimberg , Mike Snitzer , Oleksii Kurochko , Dongsheng Yang , linux-block@vger.kernel.org, dm-devel@redhat.com, linux-nvme@lists.infradead.org, "Martin K . Petersen" , Ilya Dryomov , ceph-devel@vger.kernel.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "Linux-nvme" Errors-To: linux-nvme-bounces+linux-nvme=archiver.kernel.org@lists.infradead.org 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 --- 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