Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp3682217ybt; Tue, 30 Jun 2020 08:50:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyCoM5scGaHvCgVSGkBdtpKaYAKJsLCALcwwNVV28soIPgGEuqtevUkbVpfmBURbuSOTN7k X-Received: by 2002:a17:906:b143:: with SMTP id bt3mr16222314ejb.134.1593532253693; Tue, 30 Jun 2020 08:50:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593532253; cv=none; d=google.com; s=arc-20160816; b=Cp3DgamjS4gOCKs70qemN7qZghRH0valtevvpnluX3QAdqh8sUQsRW8nDEIBzZPZ+a J3vxsKwi/o/iPK1yZFDP4z5oXe2FI4rgw/wa/jZAAjoA8GK8IHkbtnPf529PtTGJ+LjC CMBrvfjuQW3ev929FAkKDE9oRTccPsim8Twdt8L8V3EcS+JfzcXyB24gWsdgPI0/qJFO Qr1Hn75skf9R60QEh2BYaV59kWqJWbjo5L/flxUHtTuB6HMS9sxJZLbCfLK/vWwIGzR7 tMojHUAhJGEtP6G7saBe464xlIKIjy8LHoK+gg7XpL2M/dAnd7MUtNcHw89AxYrkkfVb zITw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=WtAd5FYybNH+rp/xMXXpzo1RN3eBxqiCbdZbHOnkJCY=; b=KahEqsoBcWJuqL8/tcQjkxsLyRk0TciuE0+KU3nWEcCroXg5GMXJiJa7mXdMsxVSWD Gmr3GHLVAFzOrAO7MEGPwIEOTHgpi6wYVMXebntQFBTN4T3XmUDDCveVhlS1IhVDMEuw 4iPzKlt4tZ9tyrUikooI37+PYAe4sVpLgiPBinDIg6l3dNZSGu66s/Zz5sAqrmEzw6uq Z3NmEam5kdXjeYxZLARdjdsc39WN8IFtPm+RSBNr5mHqczIWDzTuaJUEo24X5eoKE2jd jLeE5BHFfkCIPWJ+zq1C+7huTAa6w1lzwbQQGKhuIgLLmmRXcFiVpZxQB7LrXBVzh+An 6BhQ== 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 e1si1929323ejf.3.2020.06.30.08.50.30; Tue, 30 Jun 2020 08:50:53 -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 S2389709AbgF3Pt2 (ORCPT + 99 others); Tue, 30 Jun 2020 11:49:28 -0400 Received: from mx2.suse.de ([195.135.220.15]:38102 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389599AbgF3Pt2 (ORCPT ); Tue, 30 Jun 2020 11:49:28 -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 A55FEAD63; Tue, 30 Jun 2020 15:49:26 +0000 (UTC) From: Michal Suchanek To: Mikulas Patocka Cc: Michal Suchanek , linux-nvdimm@lists.01.org, "Aneesh Kumar K.V" , Jan Kara , Alasdair Kergon , Mike Snitzer , dm-devel@redhat.com, Jakub Staron , "Michael S. Tsirkin" , Dan Williams , Yuval Shaia , Cornelia Huck , linux-kernel@vger.kernel.org Subject: [PATCH v3] dm writecache: reject asynchronous pmem. Date: Tue, 30 Jun 2020 17:49:24 +0200 Message-Id: <20200630154924.3283-1-msuchanek@suse.de> X-Mailer: git-send-email 2.26.2 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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..5358894bb9fd 100644 --- a/drivers/md/dm-writecache.c +++ b/drivers/md/dm-writecache.c @@ -2266,6 +2266,12 @@ static int writecache_ctr(struct dm_target *ti, unsigned argc, char **argv) } if (WC_MODE_PMEM(wc)) { + if (!dax_synchronous(wc->ssd_dev->dax_dev)) { + r = -EOPNOTSUPP; + ti->error = "Asynchronous persistent memory not supported as pmem cache"; + goto bad; + } + r = persistent_memory_claim(wc); if (r) { ti->error = "Unable to map persistent memory for cache"; -- 2.26.2