Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp3702278ybt; Tue, 30 Jun 2020 09:16:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzHSFxI3SnEUBC84CpBQjlhDXeEFoY7KW4ODbsfaVHUwBwvHSY79MUslFz9w7pw9txH1oOf X-Received: by 2002:a17:906:2b12:: with SMTP id a18mr18691102ejg.186.1593533819632; Tue, 30 Jun 2020 09:16:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593533819; cv=none; d=google.com; s=arc-20160816; b=NHa10reHe8RekSSw1hieWokQoDmsyOdoFTdtOyIDMSuLGUyFD+bmYimf2lU88H4gY1 FE/6pQW5V/2Ry0M2owsOf8WYC3/E3lqrkHj9Vct2EZyMft5xfyJoKWyYayR6qo+KBTW2 EKBhJOlmPePMjzcSP1JdzVRMsK0RjBSsUOEx0NiH5RCxQR8jt76SVfmutkW8Qv8PEHqR eeNrsa8xbJVpjKJSJtdEDBBfbP5Kyq5YWQ6+zNzPAbIqcev3+tYOFh8kZCsvLDhXpvgF DsHVJlHofaZ9W/TAXLnbpj76sazL3xCMCyKiz0wK0DHsQFi2FP7AjBtITcbmnHdEjYi6 7IIg== 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=sUPToEOX4B/mGCL1pbKHYVjaKfSmKgEu2oySIFoO2KI=; b=GXnIZ5ZvuqFGo4nlBkGqgoomqH+Qt50Hwo//U1Q9T43P9Tl/OOscD3qNzO87nw7791 LA2ms90bXcYx3ydL7NNlUNCDgBJqS/ktXT105bHLuENSXtsL8EA5xw9JrGi3dovEjivs 9J7iqTcuf9vBimjc0OfpQTyC5ytYaQhyNZkGFetX0oTk7U2RrvKFQkTDhEYaAnP1GLjK 5ab06VY98hJ/J078TRufbgMrSoiW5KN70M4n1ul41HhiurRihT0vulk0KitKDJ5Z4JTk VCGm8YQmen99Q4iYWmcFoMosoqcIWybeQ/GiZ62JxkwOK/UVlttsRCs6cO3w0TQ1I9M6 bVlg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=b863bcVy; 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 u4si2431798edd.83.2020.06.30.09.16.36; Tue, 30 Jun 2020 09:16:59 -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=b863bcVy; 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 S1732249AbgF3QOp (ORCPT + 99 others); Tue, 30 Jun 2020 12:14:45 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:60452 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728998AbgF3QOo (ORCPT ); Tue, 30 Jun 2020 12:14:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1593533682; 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=sUPToEOX4B/mGCL1pbKHYVjaKfSmKgEu2oySIFoO2KI=; b=b863bcVyBkq9b575jzRJWBhz9juylcJK1VZceUEO+YAhlzR9e5Xuk43ByYxpHjujJePegK iB3nijwyLhFiQEW9xz68XwCbKzVECs8BgOY3Z0oK604osYy+8C3+aieSDc+tPOus6eJV2w +KiEi6ToR+9Kf57ncWotG8DDHKmNXk4= 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-19-6SsKhYcYPXW-9xb2cIECEg-1; Tue, 30 Jun 2020 12:14:38 -0400 X-MC-Unique: 6SsKhYcYPXW-9xb2cIECEg-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3426587950E; Tue, 30 Jun 2020 16:14:37 +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 376197FEA9; Tue, 30 Jun 2020 16:14:27 +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 05UGEQBl030308; Tue, 30 Jun 2020 12:14:26 -0400 Received: from localhost (mpatocka@localhost) by file01.intranet.prod.int.rdu2.redhat.com (8.14.4/8.14.4/Submit) with ESMTP id 05UGEQ44030304; Tue, 30 Jun 2020 12:14:26 -0400 X-Authentication-Warning: file01.intranet.prod.int.rdu2.redhat.com: mpatocka owned process doing -bs Date: Tue, 30 Jun 2020 12:14:26 -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: 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.79 on 10.5.11.15 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 30 Jun 2020, Mikulas Patocka wrote: > > > 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 BTW, we should also add Cc: stable@vger.kernel.org # v5.3+ > > --- > > 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 > > >