Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp3641185ybt; Tue, 30 Jun 2020 07:55:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy7Ur9O+mghW230YqvhjA7norHWWi+hufd0Pl+vjdlFqiGW1pqGuI9yZyNVjCUAWPXmsam4 X-Received: by 2002:a17:906:a01:: with SMTP id w1mr19110101ejf.197.1593528933919; Tue, 30 Jun 2020 07:55:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593528933; cv=none; d=google.com; s=arc-20160816; b=0RxEzzapEPw7L6NO5bBV8jj9kbRby2bw6sS13tWZo1Wz4u8E5hBB6PIf3ZKQlFGxJ6 +evFDlivHPa6I9+b0F7PO+wlBjeXLwNy8+i1c8zJHsrhq/AiRwSr3uArjWpKbI/M4Ecd jgXN25wErjStjvl4d3VN+cjPWyxvaBIgbAKJ93qp/tBWPQloaBBAB0ZhyCwWXLh3oweY SdUSNBLnreX/F9f8LmpSyc3todD8eRX9NPt0Ghz3l5Ire5pY8/L5z5XcypFm30UMe5Kt 7tHz1bKNovj/M5R8DFyG0wwDmkSMhtLnNO6Bq6ju6wan1wtdz7xVUC01IhAX4GHIkn+Z 9pzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:from; bh=8rUD8go4sNZEvrFV1rkWcg1wqeyjKR3y/jkeo6yL8Ok=; b=KDNdfl1IqIPxsJ2bAd2tM5xJjUdglW3WBoAB4yoIEFIXYWk4hoQuO7RjWNhQywVTy7 mjOKaxiAS06BIbFIrjVew7wjph8U7/pcjixqomFkT706PPWLMxk9hbDoOoNxnYL/Nw4H GcuAwbzbiR+VyKHYg2AcXMPCgN0xh5gFcy0Z3nBPV5gBk632+y4hsQIEHjaDTI8Q/Z6A ZGGjXfC8nKKtsGG019G26nChRdBGUyQbAMLEKVV7+k1rukCBEKccwtUnrCeIZQanJgxe QiTNmdzmj9vli0SjtMQpLr+vipIjGkntb+iCOBvl94bW40SaGODigeSMI20rbQztmH6u TN0A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e6si1863518ejx.444.2020.06.30.07.55.10; Tue, 30 Jun 2020 07:55:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389123AbgF3Oxk (ORCPT + 99 others); Tue, 30 Jun 2020 10:53:40 -0400 Received: from mx2.suse.de ([195.135.220.15]:36570 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389121AbgF3Oxj (ORCPT ); Tue, 30 Jun 2020 10:53:39 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 1713AAAC7; Tue, 30 Jun 2020 14:53:38 +0000 (UTC) From: Michal Suchanek Cc: Michal Suchanek , Mikulas Patocka , linux-nvdimm@lists.01.org, "Aneesh Kumar K.V" , Jan Kara , Alasdair Kergon , Mike Snitzer , dm-devel@redhat.com, Yuval Shaia , Dan Williams , Cornelia Huck , Pankaj Gupta , Jakub Staron , linux-kernel@vger.kernel.org Subject: [PATCH v2] dm writecache: reject asynchronous pmem. Date: Tue, 30 Jun 2020 16:53:35 +0200 Message-Id: <20200630145335.1185-1-msuchanek@suse.de> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200630133546.GA20439@redhat.com> References: <20200630133546.GA20439@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit To: unlisted-recipients:; (no To-header on input) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The writecache driver does not handle asynchronous pmem. Reject it when supplied as cache. Link: https://lore.kernel.org/linux-nvdimm/87lfk5hahc.fsf@linux.ibm.com/ Fixes: 6e84200c0a29 ("virtio-pmem: Add virtio pmem driver") Signed-off-by: Michal Suchanek --- drivers/md/dm-writecache.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/md/dm-writecache.c b/drivers/md/dm-writecache.c index 30505d70f423..1e4f37249e28 100644 --- a/drivers/md/dm-writecache.c +++ b/drivers/md/dm-writecache.c @@ -2271,6 +2271,12 @@ static int writecache_ctr(struct dm_target *ti, unsigned argc, char **argv) ti->error = "Unable to map persistent memory for cache"; goto bad; } + + if (!dax_synchronous(wc->ssd_dev->dax_dev)) { + r = -EOPNOTSUPP; + ti->error = "Asynchronous persistent memory not supported as pmem cache"; + goto bad; + } } else { size_t n_blocks, n_metadata_blocks; uint64_t n_bitmap_bits; -- 2.26.2