Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp6214633ybv; Wed, 12 Feb 2020 08:05:12 -0800 (PST) X-Google-Smtp-Source: APXvYqwjav68F34hq1EK4riB1YPGlY2o4mU8RLyV1iHErtviCYXw68Uy90bX44tLrDDMpAUjGiuK X-Received: by 2002:a9d:48d:: with SMTP id 13mr9168155otm.249.1581523512577; Wed, 12 Feb 2020 08:05:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581523512; cv=none; d=google.com; s=arc-20160816; b=B/7NZef1BIcQztcbcbxr6UUSXhorxob7YXzfiMiI1h81znxEutISL0X3vhsyWUFO2z yeJsvCX4Ewcuj5QnCW06J7mhxx1a8FykRcKU8aybF4Fi0Vxa/3p93o0bwNCQrBgqWUjg N4b3BDDzJonHKAhUU1fSVpy9AGAJSjty11ChVXx8VJXKzNY/eYc88iR/TkPPu4pCdIVA /nYlSmkcSeGB9gOG3hQZ8im6+QEEENgEel5KphJLywOfS+5aefTj72T0a+r6zOXp7V6z uUhcuRivHMcf3H7QQdAi9BOjL23jho2Mdh5mjqfRzIjcL6xZTr3WUCp3ttSEAipMIfJ2 oojA== 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; bh=mZP5npnVjD6Bxf1KA32pqduZoodEp1XVDr8pdW53Zls=; b=PnRKaQRs2Ez7IPEO78Fh1jUONkV3kq+0q3yNzie5Atk+1V9SJmbfntSeZ2vN7YyhRw YEDYJcvqAkUU0eU76QdfE0I0IElUrkaKIARPMoH1b8yhjhzcKtgsTWit4STiupZqhfjp bJFj+m8n86SmCeM4RAr5HQhGWGudyPPo+2qO240w70dHBgqPC84l8g4eqpLCK4sJc4kv 5GrWfVNakqaE+QOeoFL4a4tGMBSlpqhKk6adHmjlQ1o1i0htys3gT7xW6WUPy2MBVagP Xxswhfi1kji3eIxP6BapSZJALO2Twyb7wZoGKoJutEJ0yt86YaT1bJihSMtzNy6lraGW EoFw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-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 v6si428083ota.19.2020.02.12.08.04.50; Wed, 12 Feb 2020 08:05:12 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-ext4-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-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-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 S1726728AbgBLQEb (ORCPT + 99 others); Wed, 12 Feb 2020 11:04:31 -0500 Received: from mga09.intel.com ([134.134.136.24]:18375 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728708AbgBLQEb (ORCPT ); Wed, 12 Feb 2020 11:04:31 -0500 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Feb 2020 08:04:30 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,433,1574150400"; d="scan'208";a="251951787" Received: from iweiny-desk2.sc.intel.com ([10.3.52.157]) by orsmga002.jf.intel.com with ESMTP; 12 Feb 2020 08:04:29 -0800 Date: Wed, 12 Feb 2020 08:04:29 -0800 From: Ira Weiny To: Dave Chinner Cc: linux-kernel@vger.kernel.org, Jan Kara , Alexander Viro , "Darrick J. Wong" , Dan Williams , Christoph Hellwig , "Theodore Y. Ts'o" , linux-ext4@vger.kernel.org, linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: Re: [PATCH v3 05/12] fs: remove unneeded IS_DAX() check Message-ID: <20200212160428.GD20214@iweiny-DESK2.sc.intel.com> References: <20200208193445.27421-1-ira.weiny@intel.com> <20200208193445.27421-6-ira.weiny@intel.com> <20200211053401.GE10776@dread.disaster.area> <20200211163831.GC12866@iweiny-DESK2.sc.intel.com> <20200211204107.GM10776@dread.disaster.area> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200211204107.GM10776@dread.disaster.area> User-Agent: Mutt/1.11.1 (2018-12-01) Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Wed, Feb 12, 2020 at 07:41:07AM +1100, Dave Chinner wrote: > On Tue, Feb 11, 2020 at 08:38:31AM -0800, Ira Weiny wrote: > > On Tue, Feb 11, 2020 at 04:34:01PM +1100, Dave Chinner wrote: > > > On Sat, Feb 08, 2020 at 11:34:38AM -0800, ira.weiny@intel.com wrote: > > > > From: Ira Weiny > > > > > > > > The IS_DAX() check in io_is_direct() causes a race between changing the > > > > DAX state and creating the iocb flags. > > > > > > > > Remove the check because DAX now emulates the page cache API and > > > > therefore it does not matter if the file state is DAX or not when the > > > > iocb flags are created. > > > > > > This statement is ... weird. > > > > > > DAX doesn't "emulate" the page cache API at all > > > > ah... yea emulate is a bad word here. > > > > > - it has it's own > > > read/write methods that filesystems call based on the iomap > > > infrastructure (dax_iomap_rw()). i.e. there are 3 different IO paths > > > through the filesystems: the DAX IO path, the direct IO path, and > > > the buffered IO path. > > > > > > Indeed, it seems like this works a bit by luck: Ext4 and XFS always > > > check IS_DAX(inode) in the read/write_iter methods before checking > > > for IOCB_DIRECT, and hence the IOCB_DIRECT flag is ignored by the > > > filesystems. i.e. when we got rid of the O_DIRECT paths from DAX, we > > > forgot to clean up io_is_direct() and it's only due to the ordering > > > of checks that we went down the DAX path correctly.... > > > > > > That said, the code change is good, but the commit message needs a > > > rewrite. > > > > How about? > > > > > > fs: Remove unneeded IS_DAX() check > > > > The IS_DAX() check in io_is_direct() causes a race between changing the > > DAX state and creating the iocb flags. > > This is irrelevant - the check is simply wrong and has been since > ~2016 when we moved DAX to use the iomap infrastructure... Deleted. Ira > > Cheers, > > Dave. > > -- > Dave Chinner > david@fromorbit.com