Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp3699318ybt; Tue, 30 Jun 2020 09:13:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx8gtejbyS7j0vkxG7bFrkvOXHmOlsb+qWeGy9IyKPSM8fi6DKFlFQn7SSUEk1/reqjFJBg X-Received: by 2002:aa7:c656:: with SMTP id z22mr10231315edr.101.1593533592916; Tue, 30 Jun 2020 09:13:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593533592; cv=none; d=google.com; s=arc-20160816; b=v9SefKYbIXhdwH6/zfNQR+HirjhDhW6Pofb1o716vwbN26l4nQjc+9xUCSZCqRsiBs tOs8i61x1fpQS7cLtZnujeAzVOj0Br8wz5kHYgrNszihDfnupmvgEDoIs342q2oUW9R+ MprcTDRIIkSyHgMUMOfkjVb9b5Ex178RZRKn1TK6XX5axJfC6zHOpXh6zewdaRS8nx5/ KP/wBkupoF3W7GwyyxYiwFLttepH0h3g1XAqtX+easaqzsHZKB10l5StXt3N1HkeAmls +u5rj8FIuqldxaJeDOZ2PtMOkOO6LeSXI4Yqj1sGpg3MW2FfXTwfKBgVrSYK3juVzgpS EVVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date:dkim-signature; bh=hdekUrxaV2KDuRTiDSjdTwlVovUCyT6cEg+RNMzig2I=; b=BnFkD+DoTQ5CrQX8BoBrQ7P3JbQ+hiwqd3JoR2rhX2YFrhkb0jqoLyKJAuJpZyfrDK lMNkl8cBwygFe96HNvmAa27h1dn0UoFiRzuHf7U6pOPjt8xVOD0I/IZlubu12lg3qwBj oG9W1d55DqlBjNYHT/xStBVuxKTwzxNgwBR9g+f5EKeyzrQVst/2j9zTxIgwWZh4+60e 9jAKCrG0SS6QceIPmvmXfDAo2rP+pXMUzgS3XXXR4dsg+ZCtQbwKLGckLTNgBzGxsWgd kYwT6WTbZtxPzeERMqT2LNqJNx+U+ElOUMTdhL0zbkGRftjLqoKt0qfllIO0ROAxWQiz rKxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="MHn/RMWQ"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g11si1623907ejx.307.2020.06.30.09.12.49; Tue, 30 Jun 2020 09:13:12 -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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="MHn/RMWQ"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730513AbgF3QMB (ORCPT + 99 others); Tue, 30 Jun 2020 12:12:01 -0400 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:30317 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726117AbgF3QL5 (ORCPT ); Tue, 30 Jun 2020 12:11:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1593533516; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=hdekUrxaV2KDuRTiDSjdTwlVovUCyT6cEg+RNMzig2I=; b=MHn/RMWQUCr4Wst2P2ULUDVaY3r69oEAXW1Ksc7bl4Ub7vh/5dNrS6GejYP7IOUPHRwWnH ajIg2wMpgwjg31J4oF9YE8/7N7MAcf+6+c+zJ/xi66sQCA5N0L2H8bK0rl2J3HvNQHBFDh slcc3KA963tJEGHmrDLnhxqbaGqI7QE= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-50-DMvfPIlhMvmTntxXdpXb2w-1; Tue, 30 Jun 2020 12:11:54 -0400 X-MC-Unique: DMvfPIlhMvmTntxXdpXb2w-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A12031054F9E; Tue, 30 Jun 2020 16:11:52 +0000 (UTC) Received: from file01.intranet.prod.int.rdu2.redhat.com (file01.intranet.prod.int.rdu2.redhat.com [10.11.5.7]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 504BB10013C1; Tue, 30 Jun 2020 16:11:44 +0000 (UTC) Received: from file01.intranet.prod.int.rdu2.redhat.com (localhost [127.0.0.1]) by file01.intranet.prod.int.rdu2.redhat.com (8.14.4/8.14.4) with ESMTP id 05UGBhxm030187; Tue, 30 Jun 2020 12:11:43 -0400 Received: from localhost (mpatocka@localhost) by file01.intranet.prod.int.rdu2.redhat.com (8.14.4/8.14.4/Submit) with ESMTP id 05UGBhha030183; Tue, 30 Jun 2020 12:11:43 -0400 X-Authentication-Warning: file01.intranet.prod.int.rdu2.redhat.com: mpatocka owned process doing -bs Date: Tue, 30 Jun 2020 12:11:43 -0400 (EDT) From: Mikulas Patocka X-X-Sender: mpatocka@file01.intranet.prod.int.rdu2.redhat.com To: Michal Suchanek cc: 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: Re: [PATCH v3] dm writecache: reject asynchronous pmem. In-Reply-To: <20200630154924.3283-1-msuchanek@suse.de> Message-ID: References: <20200630154924.3283-1-msuchanek@suse.de> User-Agent: Alpine 2.02 (LRH 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 30 Jun 2020, Michal Suchanek wrote: > 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 Acked-by: Mikulas Patocka > --- > 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 >