Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp997620imm; Fri, 1 Jun 2018 13:20:33 -0700 (PDT) X-Google-Smtp-Source: ADUXVKL7j0EUAGcgOijhb1grtAQ2iwksN2ocRSun1icAJuRtsRpq94cwTq7SpsCWqpoE4W8QSNrh X-Received: by 2002:a62:991:: with SMTP id 17-v6mr12249515pfj.34.1527884432980; Fri, 01 Jun 2018 13:20:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527884432; cv=none; d=google.com; s=arc-20160816; b=d2ot0t3U6h+jZJ7CEd7+nqqOmKs3DLA9DwE4Ea2m/uRdlJPveUyPSQbqQOjnos6I98 IsJnbWw6XwjGB/PEQw5WF8lNz+y2lQjIN7H88IvQ0NrT/1BWpzQGOi6uglTT4i3uPT2I 5TivbyITeyQbZdwFBgK0Xj6YQb9HYb8vi2MZuYWmbX25qyT/kJAsTdQ0f+vAPEsEVYjN DWknkO+b+IfmYWfE6YFTpL3K5g/aYn8PYWYFaeoVMUmzobns3g+7ylu2DXPZX3esDTdz Qm+gqWXC9C85CTYqU66x7NxbkFZkjvi7t+GFZD2YQ8Ey7Mj8APvjNTtquk6+XAnaYoP0 ZAjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=rj2T/4DiPwJA6iSc0tWMLNvtmDm3Yidh+UanWUW843I=; b=0v9pgiq8T30temsvM7ez1ay5YY+3ctGtdi8IGPBCO/OcLYmxwxUJrMr/Lnkw8v6prT YA4gSj1P7IcweMdqEWeDQSDlu/y3EpUF2aLXzKawYTsNMRmCbOM+Q3JIDgLZ46XPlNMj qgRPeY3/N8kQ79NHadDaiOWx+ene559FoDAN2Pd/n8wE3Iw0Sy8LbPx5AdtMtj3CZpP0 Y10fQXS/sibXVMl3DZDFEY1PTZQc/6kI4Kt00Y7D9x3uEfPzKno8coeeZzKvzt3FyPjQ B/zzcMzHA3YczMvlOv9GmOmuiYim06m/KCDEr86rrPCkrZ1ZhF8Rn3fHVo55G7/DTR35 qzvA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x1-v6si38577397pfm.32.2018.06.01.13.20.17; Fri, 01 Jun 2018 13:20:32 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753253AbeFAUTs (ORCPT + 99 others); Fri, 1 Jun 2018 16:19:48 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:49342 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751835AbeFAUTo (ORCPT ); Fri, 1 Jun 2018 16:19:44 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 878D6818BAFB; Fri, 1 Jun 2018 20:19:43 +0000 (UTC) Received: from localhost (unknown [10.16.197.123]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7EAAA1134CC7; Fri, 1 Jun 2018 20:19:40 +0000 (UTC) Date: Fri, 1 Jun 2018 16:19:25 -0400 From: Mike Snitzer To: Ross Zwisler Cc: Toshi Kani , dm-devel@redhat.com, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-nvdimm@lists.01.org, linux-xfs@vger.kernel.org Subject: Re: [PATCH v2 3/7] dm: fix test for DAX device support Message-ID: <20180601201924.GA1144@redhat.com> References: <20180529195106.14268-1-ross.zwisler@linux.intel.com> <20180529195106.14268-4-ross.zwisler@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180529195106.14268-4-ross.zwisler@linux.intel.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Fri, 01 Jun 2018 20:19:43 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Fri, 01 Jun 2018 20:19:43 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'msnitzer@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 29 2018 at 3:51P -0400, Ross Zwisler wrote: > Currently device_supports_dax() just checks to see if the QUEUE_FLAG_DAX > flag is set on the device's request queue to decide whether or not the > device supports filesystem DAX. This is insufficient because there are > devices like PMEM namespaces in raw mode which have QUEUE_FLAG_DAX set but > which don't actually support DAX. Isn't that a PMEM bug then? What is the point of setting QUEUE_FLAG_DAX if it cannot be trusted? > This means that you could create a dm-linear device, for example, where the > first part of the dm-linear device was a PMEM namespace in fsdax mode and > the second part was a PMEM namespace in raw mode. Both DM and the > filesystem you put on that dm-linear device would think the whole device > supports DAX, which would lead to bad behavior once your raw PMEM namespace > part using DAX needed struct page for something. The PMEM namespace in raw mode shouldn't be setting QUEUE_FLAG_DAX, if it didn't then the stacked-up linear DM wouldn't > Fix this by using bdev_dax_supported() like filesystems do at mount time. > This checks for raw mode and also performs other tests like checking to > make sure the dax_direct_access() path works. Sorry "This" does those things where? > > Signed-off-by: Ross Zwisler > Fixes: commit 545ed20e6df6 ("dm: add infrastructure for DAX support") > --- > drivers/md/dm-table.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > > diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c > index 0589a4da12bb..5bb994b012ca 100644 > --- a/drivers/md/dm-table.c > +++ b/drivers/md/dm-table.c > @@ -885,9 +885,7 @@ EXPORT_SYMBOL_GPL(dm_table_set_type); > static int device_supports_dax(struct dm_target *ti, struct dm_dev *dev, > sector_t start, sector_t len, void *data) > { > - struct request_queue *q = bdev_get_queue(dev->bdev); > - > - return q && blk_queue_dax(q); > + return bdev_dax_supported(dev->bdev, PAGE_SIZE); > } > > static bool dm_table_supports_dax(struct dm_table *t) > -- > 2.14.3 >