Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp5333358ybv; Tue, 11 Feb 2020 13:42:55 -0800 (PST) X-Google-Smtp-Source: APXvYqxiENQNrk4BBgo5mStsjvQy9f61p+CudZ3hC1RgrHCW7QTp2GMDsA6A8GPITRmF7sCXZpfM X-Received: by 2002:aca:d502:: with SMTP id m2mr4057194oig.41.1581457375178; Tue, 11 Feb 2020 13:42:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581457375; cv=none; d=google.com; s=arc-20160816; b=GjKwmHVIfrLNTs1+OcidqvKmGuSjz0zcKv27c4kx3vDMwm6pinizjkDRulYbN3rEpF L+F8XrohICmGlGTWZRUnQKRzQ0OO8qkQBI4OV98H8mSJX4iszIAlDNx1LvVb1vNb/ghZ b4p1T3JtHxck/PbfHBp5eIxzzeunHsRS244t3gEPbEs7xs0ale58P6OJWluProy/g4dP UlqMh+gOTsw1CHdg+HUK88zTWFnrTRxfQoulRAAEDPojUDINCUJRApw0ICOxNsVKnPRS miexyV6b6IIyFtdl0po/vQlQtKw9MJRV+hhmVenP2UEUArStHjko4cS3tNU5gnZ3TbuT LPGw== 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=LJZwzsfCKWFPGupnlznvBm9wXZDQ52UdTaNsuOIa71U=; b=1B5g59nQvHw8bUNA8V1pmTGweu5mQjUcaOKLYZToyPehqvIBUqLSOEEbLvXpjbH5J0 i7lOySaG5fezLJG7IWu7Vn/nyD1UiiDFRnRhZ3CfSKq7L12aqXtHNgsfUUqmhTOJhdtX ttLUJgfD2Xhihvt9D5chGLiuI7TpmTygnnP75QcXDfP+XAeUuAqZOHP+X+mglnyptdTy i75Sn9JXu6saAd5AV7zA9sY/fR+JaUAD39hGkbzxqDQqtFfPiU0rDHUyIBvT8ZXqjlnD wPsJ/Hu3yBynYZIWEYM+1kaOFqWxLrlHVDmZqcu9yxwXHdoAi56hldd4fpD+tyOXR7UG bieA== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q124si2277118oig.228.2020.02.11.13.42.44; Tue, 11 Feb 2020 13:42:55 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731127AbgBKUlN (ORCPT + 99 others); Tue, 11 Feb 2020 15:41:13 -0500 Received: from mail105.syd.optusnet.com.au ([211.29.132.249]:48892 "EHLO mail105.syd.optusnet.com.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728512AbgBKUlM (ORCPT ); Tue, 11 Feb 2020 15:41:12 -0500 Received: from dread.disaster.area (pa49-179-138-28.pa.nsw.optusnet.com.au [49.179.138.28]) by mail105.syd.optusnet.com.au (Postfix) with ESMTPS id 437473A30A3; Wed, 12 Feb 2020 07:41:08 +1100 (AEDT) Received: from dave by dread.disaster.area with local (Exim 4.92.3) (envelope-from ) id 1j1cLD-0002wq-H5; Wed, 12 Feb 2020 07:41:07 +1100 Date: Wed, 12 Feb 2020 07:41:07 +1100 From: Dave Chinner To: Ira Weiny 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: <20200211204107.GM10776@dread.disaster.area> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200211163831.GC12866@iweiny-DESK2.sc.intel.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.3 cv=W5xGqiek c=1 sm=1 tr=0 a=zAxSp4fFY/GQY8/esVNjqw==:117 a=zAxSp4fFY/GQY8/esVNjqw==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=kj9zAlcOel0A:10 a=l697ptgUJYAA:10 a=QyXUC8HyAAAA:8 a=7-415B0cAAAA:8 a=oagkb_tiXJ3G83dhfBYA:9 a=CjuIK1q_8ugA:10 a=biEYGPWJfzWAr4FL6Ov7:22 Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org 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... Cheers, Dave. -- Dave Chinner david@fromorbit.com