Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp1044262imm; Fri, 1 Jun 2018 14:17:16 -0700 (PDT) X-Google-Smtp-Source: ADUXVKILH9gLJuY4Khwlr9oiwFw/7SoejsxKvvBnxl5t2vT2ZbNIfSRB1ZuoNvHiKGRCOk+da5uc X-Received: by 2002:a62:d653:: with SMTP id r80-v6mr12337316pfg.54.1527887836786; Fri, 01 Jun 2018 14:17:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527887836; cv=none; d=google.com; s=arc-20160816; b=DpCsjxIbBtPLmYhiXjp62CzG+LW9qUIkhOjO9o67jBiXsLTxWxaqTcZ4h0JCkeXMBP SpmWCCAVJaEEzXMB1bsplsTrR9rvO5yFhNJ1TjU5pZlbpgTa98RKjXa9iyObRDV5iIrR UrH6Tu4Q7m0f03lVPiXRn/PB9U+xmvkPhTRsZy1MubmoMSQmeKqdOD7qWetKX7jVJwob 4EDTRMH2RRcFnW9uzyX+IiNt4o0fSa29HIVeH1UuEsCzEJKu4rts7Maj0qx9Z1QHYxjk /Hhnlv5J4htywh38WwuccrSP1BE3ZsBJhHU3oo9Q7omKK5w5F3lE4/ocVABXSlBlxdRp AGbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=5QY/dVcw/SU2w92IFg/BNLYR7qpmkwPnMSMUiZ8nRV4=; b=Zy92qxbHc7J5ZxcZZyKNfJ1eet2+ip31RM6XcaRocc8w1gdOX7avC4WQkXTM1nGOTi kuPS1zGecW/O6AQHrsoI3mfoIZSbLmQLHq2azaOyZWz6PLypUyP39F4Suy9OpfA+f7yt zY3CdFxU4FqI7Rx+wxq+BaRlEJh//PBIyY8siwVTBIHHyQnhsgE5Dicv8kfdhClIlxrd PKES5eLE9OI9BHPK4MF215Z7w+Vjpk4j1CnRA8CQrfeFezdCJ2nJA2bRsLsRQ4cAW+Tx k4502kRgJSf94kawXHmA7i5H/4yyRzT9Y6dsMVxxJA+/or4TeVnwPgQUBwqbVpXv1z3Z 2lFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=JMQhSHEe; 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=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q137-v6si2090162pfc.164.2018.06.01.14.17.02; Fri, 01 Jun 2018 14:17:16 -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; dkim=pass header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=JMQhSHEe; 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750989AbeFAVQg (ORCPT + 99 others); Fri, 1 Jun 2018 17:16:36 -0400 Received: from mail-ot0-f195.google.com ([74.125.82.195]:45653 "EHLO mail-ot0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750726AbeFAVQe (ORCPT ); Fri, 1 Jun 2018 17:16:34 -0400 Received: by mail-ot0-f195.google.com with SMTP id 15-v6so30832932otn.12 for ; Fri, 01 Jun 2018 14:16:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=5QY/dVcw/SU2w92IFg/BNLYR7qpmkwPnMSMUiZ8nRV4=; b=JMQhSHEewjMSazKMG9BQdzPBseDND9qvUuCM3SGYz5riIAxlT3McAXnf0pPUWr7/mV S3CLF+xWAZsmCfiCUJQAeV4VfhZO0eqCNlZJFNvSKgFQRVzXuKukpIICrfe18kowfKKz 0ya7oErCJHImAid2voS/V0lD1VHDx9tzMwC8Fcj6Jf7E8sVSx3dD69K+5g/GzvX8rOXC At05eMrbB8XilskXCj7Mhk4JpP4brK+iwgR/h4OLHPmXrBYp2KLW3bKhIZN2+sGuXCc3 ai0zEp+i7b+NcQkMb6XjFckSz6QF/0QrdjiFJwUBdpEEex7FO3Oplgss+3gqy8a2JwsG 4fMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=5QY/dVcw/SU2w92IFg/BNLYR7qpmkwPnMSMUiZ8nRV4=; b=ltAVG/yDOh4JBtBFXG0TR7Anr2WUaP+gXMEh5mdo1M4y36399cQVIZbLmt7VzAx4wr ESjclazIlzKjywWWBHgePWSdDcAlf6e5dXQsZbKmoXjbR6AeHrsasUWvfR43Ba7ZHeQr bCVJnEnWfufLpo8HslKADvu6RtlFNGPbXt8iaXIKnIbzLOxm27gnJ7nSN8UgVpckcqTM uAzMREFXR4sD3FJxWsIYkZ2t8surdT88AD0N8oBuTrw6pWD/VuRqnq5ssgSd0pkfFWTo 4VXvGJjOFipdgBrDHwhYpHLkPiRyqTPvYz0VPScWkeWzqU4AovwqTCdAjYBtOS/yt189 Ie6g== X-Gm-Message-State: ALKqPwf6BlnUVDThYMSLVYuTVEaOD3Te9B+7rVG5ljIYDYQOsp3IdceH uzkeRh6xELMb0WkB/jrES4LsZND3LKa26y8qdv/kRg== X-Received: by 2002:a9d:2371:: with SMTP id k46-v6mr9036502otd.210.1527887794325; Fri, 01 Jun 2018 14:16:34 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a9d:2ea9:0:0:0:0:0 with HTTP; Fri, 1 Jun 2018 14:16:33 -0700 (PDT) In-Reply-To: <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> <20180601204604.GB1144@redhat.com> From: Dan Williams Date: Fri, 1 Jun 2018 14:16:33 -0700 Message-ID: Subject: Re: [PATCH v2 3/7] dm: fix test for DAX device support To: Mike Snitzer Cc: Ross Zwisler , linux-nvdimm , Linux Kernel Mailing List , linux-xfs , device-mapper development , linux-fsdevel Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 1, 2018 at 1:46 PM, Mike Snitzer wrote: > 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). I'd say just make a topic branch on top of xfs and merge it... with Darrick's permission of course. It might also mean you should wait for the xfs pull request to go to Linus first during the window.