Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp3542728ybt; Tue, 30 Jun 2020 05:38:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwC6IoRUH1rko8mxei3xpkK6IkyAeLPEbU0AYf5b7hlZpoPRMKpPTHUoceM7EwTdurhllYQ X-Received: by 2002:a50:b0a1:: with SMTP id j30mr22814835edd.387.1593520717144; Tue, 30 Jun 2020 05:38:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593520717; cv=none; d=google.com; s=arc-20160816; b=c96iQSMnpLhJKIf73AUNW/3ppDNAMcWnAu2BWYJ8zVkVfj1Pu4PkQ+0lPqLSLjClMD YakmYe1tHgp82LRdFp/OMnTdCiJGKFjYsElhXC3LJ2ZsmNzXz2EdUxv3H0BQIwxkx2QT p4bhynikJrNxWO4QdNMVPlzuwykLIlMws75NIWANcgEK0GSsYSIpJKyQYAFG4XndVJr+ BnKMTbAATVKX8WIidCdU1nrCZZvJohmoZJPe+pKpT2Xn0YJsTgdX+LafPMLwGPLnxx9/ KLsmUYzzwCsn7Vaw601rpDXyUKmOETTXK4ATogM0O9EJXWBm0SUKkJbwcjhqlXKYD4iX nHRA== 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 :message-id:date:subject:cc:to:from; bh=citPb6P4sP9h/bR8lpMOhw/ky8Oo3+PBWKLQ7nCwcPo=; b=h3nJu1HS+LwzARzXraglV0g865B6IggZEAbiPtGvfAOOstGU1PJ+kSc1U1JaxZM5Jz weW/2JWjONeh28/hW6/5QdDhhBIHXzMJ4uwNQXgl+7lZJLbFLDRvYtZ1d2XTpEq+hVq1 iLx+S36gPEbHKKR1cPGgg72eWDSRtg59ZIQWQfDvjg0kadz6Y9f2Ic9QJU1QGhzZgzUj POlM8OvXIbo+9yDVXBRfTwAbLd99Utl5utKqc+c8NmFiW5OUilWh1UStxzYnhpyXsTuQ jsGqlvQSyFxqyUw45Nnz0++stmzKhLiR3JBUSTsjgxwGJBQt5gsf5ZN6vP8oEq8NmQsW 92xQ== 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 f11si1602100edr.42.2020.06.30.05.38.12; Tue, 30 Jun 2020 05:38:37 -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 S2387670AbgF3Mfj (ORCPT + 99 others); Tue, 30 Jun 2020 08:35:39 -0400 Received: from mx2.suse.de ([195.135.220.15]:42212 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732042AbgF3Mfi (ORCPT ); Tue, 30 Jun 2020 08:35:38 -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 7A421AF24; Tue, 30 Jun 2020 12:35:37 +0000 (UTC) From: Michal Suchanek To: linux-nvdimm@lists.01.org Cc: Michal Suchanek , Mikulas Patocka , "Aneesh Kumar K.V" , Jan Kara , Alasdair Kergon , Mike Snitzer , dm-devel@redhat.com, Pankaj Gupta , "Michael S. Tsirkin" , Yuval Shaia , Cornelia Huck , Jakub Staron , linux-kernel@vger.kernel.org Subject: [PATCH] dm writecache: reject asynchronous pmem. Date: Tue, 30 Jun 2020 14:35:28 +0200 Message-Id: <20200630123528.29660-1-msuchanek@suse.de> X-Mailer: git-send-email 2.26.2 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..57b0a972f6fd 100644 --- a/drivers/md/dm-writecache.c +++ b/drivers/md/dm-writecache.c @@ -2277,6 +2277,12 @@ static int writecache_ctr(struct dm_target *ti, unsigned argc, char **argv) wc->memory_map_size -= (uint64_t)wc->start_sector << SECTOR_SHIFT; + if (!dax_synchronous(wc->ssd_dev->dax_dev)) { + r = -EOPNOTSUPP; + ti->error = "Asynchronous persistent memory not supported as pmem cache"; + goto bad; + } + bio_list_init(&wc->flush_list); wc->flush_thread = kthread_create(writecache_flush_thread, wc, "dm_writecache_flush"); if (IS_ERR(wc->flush_thread)) { -- 2.26.2