Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp1019464imm; Fri, 1 Jun 2018 13:47:32 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJ9vwrG6gEX3utaI03cH5G5y4ywTpyVy7utmG5P08X+RbAUIuA4CBHzLVgkLcAfHmJSOGlb X-Received: by 2002:a63:56:: with SMTP id 83-v6mr9734462pga.29.1527886052589; Fri, 01 Jun 2018 13:47:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527886052; cv=none; d=google.com; s=arc-20160816; b=hc9J7+SruDKm/ZOe22t69lZerYUBGqshAvdzbdbGNt9yZzlF6v8xgdaWMl360nUuIi Q9/57KlbjNayJh5aUBi6EzxBQPk7Y8PVL0Kl9GNRJzt3cNG4E6PDMOgYodhJQ/lbOJlQ H2wP1Eq4vXJVLp9kxp21/TkbaOs0ILtHFgr5FhKWubuLkjMdIhwkxGfnEUEngaxEQVZI SHP7cUUmpwI0pZrgt0C3R+5GeWrVxyURF71rGiBQt/45TvDfIVOOF+ZC2QxL4hmKqQcW L+n7YSIt4s4VSK2UKCrjeJj4m7J9fLJNCfjq3+IUuE5AptLJUjUPJ8jfuGt20o/mdMwr 2Mtw== 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=Xz7BIrydaqioJfjLc6Fj88cQ93h3sNZpMIkiuhsf6ao=; b=nG0s1Hg0VU5/7kKPV6aOtZ2t0ODA9CqqHU+UpqBalAsEDqLt8iwdsY5tAPgn1onJEJ PizhzmlggzJTyicHcdVrBtrxxONI9FlKYtRzSvypO1vwglJIel5/VRDOwwIurwuFqQoA uzOHRQr7so+lFTvjmZgOk4aUmcRLJSdgJqhHwL1UT31A2HsHI6maI6fzOZ6uqPjg8l6l Orst/tEDhCccOK/M70tBsuMpvJP1fehLkiB5K1emcLPs1miP8IwTHic+POlQKE4phbMk z6nMqdh0kaqm6Il4X9DguD81ZCCx+NXoHVk6gkf2/oSQDv5pAoli7D69A7RimRGtnL1c GZUQ== 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 b66-v6si40801137plb.107.2018.06.01.13.47.16; Fri, 01 Jun 2018 13:47: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 S1750852AbeFAUqY (ORCPT + 99 others); Fri, 1 Jun 2018 16:46:24 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:53188 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750724AbeFAUqX (ORCPT ); Fri, 1 Jun 2018 16:46:23 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id F0619859B2; Fri, 1 Jun 2018 20:46:22 +0000 (UTC) Received: from localhost (unknown [10.16.197.123]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DB31084444; Fri, 1 Jun 2018 20:46:19 +0000 (UTC) Date: Fri, 1 Jun 2018 16:46:04 -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: <20180601204604.GB1144@redhat.com> References: <20180529195106.14268-1-ross.zwisler@linux.intel.com> <20180529195106.14268-4-ross.zwisler@linux.intel.com> <20180601201924.GA1144@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180601201924.GA1144@redhat.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Fri, 01 Jun 2018 20:46:23 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Fri, 01 Jun 2018 20:46:23 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.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 Fri, Jun 01 2018 at 4:19P -0400, Mike Snitzer wrote: > 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? I see you meant bdev_dax_supported() does these additional checks. My previous question stands though. Why is QUEUE_FLAG_DAX getting set if the device hasn't already passed these checks? Shouldn't setting QUEUE_FLAG_DAX on request_queue depend on bdev_dax_supported() passing? But looking at the drivers that do set QUEUE_FLAG_DAX: they don't have the bdev readily available. Anyway, just strikes me as bizarre that a driver can set QUEUE_FLAG_DAX without having to have ensured bdev_dax_supported() passes (even if not programatically, but that the developer has verified the hooks, et al exist). But I'll give up on this line of questioning.. My dilemma now is: how do I take these changes without first rebasing linux-dm.git ontop of Darrick's xfs tree? I probably should've reviewed faster and been the one to take the entire set (with appropriate acks obviously).