Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3502359pxb; Mon, 24 Jan 2022 10:54:23 -0800 (PST) X-Google-Smtp-Source: ABdhPJw0PW9a4u1QgZAdZYkYa6DhSU796LBXwhH1sg7Dyg/7TeoCYMb+gz1T466auiVgXF8b3fwA X-Received: by 2002:a17:90b:38c9:: with SMTP id nn9mr3208188pjb.219.1643050463389; Mon, 24 Jan 2022 10:54:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643050463; cv=none; d=google.com; s=arc-20160816; b=HJcYAdoTIHB30WXDxbCWf8S7RIBbuw8wrlU+xuyCu+Wk6MjRn7MtF5Pv6PyLfNI9U/ 5K0DmcIjAXWu+8J94FRPcc9MpjPB1LRYf7Tz9fYcorAlrNj1EthCMFVfbAl6z4Wz9Aeb PfrIO0nrufCb7+v2wVOMqxsrQT5S8XhgCyjj77rOKkJnzwuoXDf5S57OT+qCpmNjT8jY 6QBIg65Q09I2ltwHJDNF1wSlF3ACqlg2Q2hFkPyGikKD3Hr0Jt8ebDRVZnNpmdCl8BHL vfONooI4HbJ2jA2y4v2SAJ412+zetwVgkTD0JhpFMEQlUDgMUp9dmo1MX07alZ3swahL G+AA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=UeEStLq1BcaRCxlc7CK5jWbcG0Yi+4h/9FQlvr3ixBU=; b=xDDXmq33M9iTiSZweTd+sP8BZtr5wiFVT3HY4of5WCLb8KqkBTZRt5tboj1Vkug7pp GDjLtxnhMLzUMG8HxFbf4uk5miUjR4OU1ZH40d7910/jcymMQbnfIQBMC2rYxxclMaBz Z9YQcHqz/WR2DQMyhIy9J7tE1+IG9ZbKHjBeYBnl7/XJLyECSDASEZ3tD7arZjIBuc/r uJVfvtyKKP/3ezbTd/pXNQjL/RFG8Rtd4m7ePd1cLBdqag9sBSHRNMeLfQMpcoj/cOs+ ZO9RcnmgeLEXYZRhg4V+lYpx0iGjDRYRGYtJac81enltuou1STvZK5ohcJ5qAgirYTQ0 bkTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=AqbURbgT; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r9si13873305pgk.611.2022.01.24.10.54.09; Mon, 24 Jan 2022 10:54:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=AqbURbgT; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235066AbiAXI4a (ORCPT + 99 others); Mon, 24 Jan 2022 03:56:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43740 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232547AbiAXI43 (ORCPT ); Mon, 24 Jan 2022 03:56:29 -0500 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 974B5C06173B; Mon, 24 Jan 2022 00:56:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=UeEStLq1BcaRCxlc7CK5jWbcG0Yi+4h/9FQlvr3ixBU=; b=AqbURbgTjyxvDrFz8NjYHx7gka p7fHZJQ/PKW4QktMWpkLsjNHc+NXOBgYeYxw7buCKzE9cI6oj3i7jvbO3oTjoQIVILFYSeOq+vR6C 0O6aWDNH6kvejWIMRISU2QEzLkGfSAo2b2tVQxfr+feytZxFq1lRNPiBuKCekf/osPEOVsudAVJnI HcmglMDhItYNdfWJeKjtbnnChfOvmzpD8HVHELXXSeDpQkRejvKlmlgr0xzTzm7zY1AmpxTS9c6X/ ZAomAuKWJDJ9NddslHFKG2OTjts/MYHkXRux/lI3lf9czp+iXnlxKwhKMm6GEs5VPRxsokUsrbxCN 8VutyOiA==; Received: from hch by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nBv9F-002h4I-0F; Mon, 24 Jan 2022 08:56:25 +0000 Date: Mon, 24 Jan 2022 00:56:24 -0800 From: Christoph Hellwig To: NeilBrown Cc: Trond Myklebust , Anna Schumaker , Chuck Lever , Andrew Morton , Mel Gorman , Christoph Hellwig , David Howells , linux-nfs@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 11/23] VFS: Add FMODE_CAN_ODIRECT file flag Message-ID: References: <164299573337.26253.7538614611220034049.stgit@noble.brown> <164299611280.26253.2845018521780218144.stgit@noble.brown> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <164299611280.26253.2845018521780218144.stgit@noble.brown> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On Mon, Jan 24, 2022 at 02:48:32PM +1100, NeilBrown wrote: > Currently various places test if direct IO is possible on a file by > checking for the existence of the direct_IO address space operation. > This is a poor choice, as the direct_IO operation may not be used - it is > only used if the generic_file_*_iter functions are called for direct IO > and some filesystems - particularly NFS - don't do this. > > Instead, introduce a new f_mode flag: FMODE_CAN_ODIRECT and change the > various places to check this (avoiding pointer dereferences). > do_dentry_open() will set this flag if ->direct_IO is present, so > filesystems do not need to be changed. > > NFS *is* changed, to set the flag explicitly and discard the direct_IO > entry in the address_space_operations for files. Looks good: Reviewed-by: Christoph Hellwig It would be nice to throw in a cleanup to remove noop_direct_IO as well.