Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp5686380pxb; Wed, 26 Jan 2022 18:48:39 -0800 (PST) X-Google-Smtp-Source: ABdhPJzpwCxwyoZAbhWnkcZrLf0CA9AtvddIacM6EX920d0ZC4FJZH5oBHX3P8RtHLg6G6QXclYr X-Received: by 2002:a17:907:6e28:: with SMTP id sd40mr1439912ejc.294.1643251719711; Wed, 26 Jan 2022 18:48:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643251719; cv=none; d=google.com; s=arc-20160816; b=AlVEdQytYuNbxjU/AcDXNAJInZZw3rNWucTslz+WefuTYQlN6wn0GLhSG8BbYUvlqA nNWWeQOX2bE9gqNQyJK6+OMwtd/+hr5Ft6GlKgswSF/Lp2a/FASq25FaxJuE+n6gg6WK XbqZ0ybZgJgCMydRGiNUuVJ0kTn3QeoTzvEsBQZpdXTcXTXTer5Pan9nvsegoxEZprpd /U4ZWGUKRLfGvnddfLXL94WFEZLBqVfze7pG21wWgjY33vGn+qlDbLLurpHEyNaH5FDr S2VftVug6t2TNA/OI1anASoB/zseKGlLlyjz9JH784TPpaxciPHZZx1Yax97lJ8KyjGP PlyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:references:in-reply-to:subject :cc:to:from:mime-version:content-transfer-encoding:dkim-signature :dkim-signature; bh=XAxGUgZjMfRYcheCAvGcdbuwhS+6jxtGJ++NzQbXLbs=; b=q3SbD1ZSNO0KRJLJ/BppOLs77fimKZ1t5gbkKE3siqFJIcTEme2OLcQ/cmoOhyKC3c l2xroeLKFqwbw7Qcb32ddkhsHTBDGjl08P2UyNdYqSmJjUENkJAcCxadSq5qWdYN1ENY ovMsJ9S6xlkVV+6RACNFEyqj4hjYp20CPxfSpEtwknsiks1dqYho99iiC24WQfCyVuoI 1uJJlSN2fkulGAt8mVeV1dQW1dmSgoXLzhaGVFQsaVm2SCZ9vE+2NSnYemMu1xWZ/vtW RBSeVTdq500T4xzRb5HrMWO96UURlcuKucvZSuN272wQ73vRG45kXZvff4LLT1FEBlAo wpOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=mff66aUs; dkim=neutral (no key) header.i=@suse.de; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ds7si862518ejc.603.2022.01.26.18.48.02; Wed, 26 Jan 2022 18:48:39 -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=@suse.de header.s=susede2_rsa header.b=mff66aUs; dkim=neutral (no key) header.i=@suse.de; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229980AbiAZWOu (ORCPT + 99 others); Wed, 26 Jan 2022 17:14:50 -0500 Received: from smtp-out1.suse.de ([195.135.220.28]:41022 "EHLO smtp-out1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229490AbiAZWOt (ORCPT ); Wed, 26 Jan 2022 17:14:49 -0500 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 8FDB121115; Wed, 26 Jan 2022 22:14:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1643235288; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=XAxGUgZjMfRYcheCAvGcdbuwhS+6jxtGJ++NzQbXLbs=; b=mff66aUsTySR80NmIG6DFMDZ8GOSZWBzAb6QezcCyekTKeq0vaL4p57+me2lhVr9SxNgDq 5PrkZNO/w2zB5kgRuauSKoDUKN1aObBFWp1LheRHzZACgfpO+VXiiCtPEZKhuzochTgn4x dQuDMpHgMQMZt9xRtxBxbL4VkOHvKaw= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1643235288; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=XAxGUgZjMfRYcheCAvGcdbuwhS+6jxtGJ++NzQbXLbs=; b=qZsxwnV2bCYEJrrqd0i6b3VKdv+EWpeCYEtnRvGhfI7zYjGmVoQzl23i75fR7TVdDKLmGa 4wqjwIkIgmIH2aAQ== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 7C2361330C; Wed, 26 Jan 2022 22:14:45 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id rMG3DdXH8WH4TQAAMHmgww (envelope-from ); Wed, 26 Jan 2022 22:14:45 +0000 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit MIME-Version: 1.0 From: "NeilBrown" To: "Christoph Hellwig" 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 In-reply-to: References: <164299573337.26253.7538614611220034049.stgit@noble.brown>, <164299611280.26253.2845018521780218144.stgit@noble.brown>, Date: Thu, 27 Jan 2022 09:14:41 +1100 Message-id: <164323528189.5493.7196087998245554506@noble.neil.brown.name> Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On Mon, 24 Jan 2022, Christoph Hellwig wrote: > 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. I don't want to add this to the present series. When it lands I'll send patches to the various filesystems to switch to using FMODE_CAN_ODIRECT. Thanks, NeilBrown