Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp3647761ybt; Tue, 30 Jun 2020 08:03:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyxLjk5RqYgJYv5D0URwhchPoE7VUs6mKptHYDBmtrgWJ32CQhaxciO8+Jm3efFbfySgPl1 X-Received: by 2002:a17:906:3158:: with SMTP id e24mr18280349eje.543.1593529423574; Tue, 30 Jun 2020 08:03:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593529423; cv=none; d=google.com; s=arc-20160816; b=nj87+8U02nRuQLTsRI1etpyVtKJ7y73BVQPLMuOjOLOLfmZcld+kVQHXkC8zRkxoJL c+S40OSouVi7Sf1ImyzDi8IwwG/pF2x87647b7kP1vYl1eMMCbc/CpovsAGtOgda8gpi jkKpMxRSkYM/K2edkBevCyraudvBDwt2ptY+ETSCL8g00uyttjwo3k54aHRrXU9NZat3 ojJoziajRVbrUlNb0yGx2EdvkUw2hwZtVDCqxRILZSL/iHLNlHfcqU2A5O6QtT6vpQlx UHO7uyQw4/AU6dt+x6IsBPJgToxFVNYX0PsB6IrUdJfNpltUOsVeCHrEV5QrYEL2Dz9D WF8w== 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=nVqdDUMAVaPMx+jj87jZtZveQ6A0HvSwgZ1JzvOfqMI=; b=MUVYK+VgI9H080pqCSbEuO8FY1mLQZV0YCFNEbEO09kGxv9uImwiyZIqtWuD30sP9X Wc6v0DZoo3U54qLTQeiKDC93jgS5BkbOevlSwjXZ8cJQ71iDq2g04JYIw/dOfn4qq2vo WKO1a8YvfXCzaJbss5GClXfgEeeuXIuzmAX+u1oLfxJzPEzQZ3oRoqMkGBcmg6uSdViR tUrG09qetpCyc62Gu7iMA0TbFzRtu8hRAbFUMpxtnTF1qlVnQRhzfhEuXfwMyhunHmHB w8R63XX3RQ03qegahob6LTSefBxV4g+mx0YFK7dTqEIFPUPrnUBNmMGgOoahmlLetvl/ WHbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=SXQkBIHO; 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 e17si1862059ejk.740.2020.06.30.08.03.19; Tue, 30 Jun 2020 08:03:43 -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=SXQkBIHO; 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 S1726941AbgF3PCz (ORCPT + 99 others); Tue, 30 Jun 2020 11:02:55 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:27905 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725872AbgF3PCz (ORCPT ); Tue, 30 Jun 2020 11:02:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1593529374; 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=nVqdDUMAVaPMx+jj87jZtZveQ6A0HvSwgZ1JzvOfqMI=; b=SXQkBIHOaONiDOCkB5vEgcgLDxyZaSQcdmEUWy0pS+saZgi+GWP675z1GqPFL/uDLDid0a JEDxagFqPXUZz4AAdQxGFvpZvStEqCukZ0UcDsffNFqGNZ+yPsP1MRXPQ/hS3MybeZ77uk JIe8qKwd3InxRS9wavdsAEHjK41rnmw= 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-502-lqlA-EagO560bmAOpN5WUQ-1; Tue, 30 Jun 2020 11:02:48 -0400 X-MC-Unique: lqlA-EagO560bmAOpN5WUQ-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 5C539100CD14; Tue, 30 Jun 2020 15:02:20 +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 295CA10016DA; Tue, 30 Jun 2020 15:02:20 +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 05UF2Jxv024072; Tue, 30 Jun 2020 11:02:19 -0400 Received: from localhost (mpatocka@localhost) by file01.intranet.prod.int.rdu2.redhat.com (8.14.4/8.14.4/Submit) with ESMTP id 05UF2Jpw024068; Tue, 30 Jun 2020 11:02:19 -0400 X-Authentication-Warning: file01.intranet.prod.int.rdu2.redhat.com: mpatocka owned process doing -bs Date: Tue, 30 Jun 2020 11:02:19 -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, Yuval Shaia , Dan Williams , Cornelia Huck , Pankaj Gupta , Jakub Staron , linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] dm writecache: reject asynchronous pmem. In-Reply-To: <20200630145335.1185-1-msuchanek@suse.de> Message-ID: References: <20200630133546.GA20439@redhat.com> <20200630145335.1185-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 OK. I suggest to move this test before persistent_memory_claim (so that you don't try to map the whole device). Mikulas > --- > 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 >