Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751687AbdITUiI (ORCPT ); Wed, 20 Sep 2017 16:38:08 -0400 Received: from hurricane.elijah.cs.cmu.edu ([128.2.209.191]:55608 "EHLO hurricane.elijah.cs.cmu.edu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751367AbdITUiG (ORCPT ); Wed, 20 Sep 2017 16:38:06 -0400 X-Greylist: delayed 2031 seconds by postgrey-1.27 at vger.kernel.org; Wed, 20 Sep 2017 16:38:06 EDT Date: Wed, 20 Sep 2017 16:04:09 -0400 From: Jan Harkes To: Miklos Szeredi Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Al Viro , David Howells Subject: Re: [PATCH 03/10] coda: honor AT_STATX_DONT_SYNC Message-ID: <20170920200409.uksexswwko54ymg3@cs.cmu.edu> Mail-Followup-To: Miklos Szeredi , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Al Viro , David Howells References: <1505896805-12055-1-git-send-email-mszeredi@redhat.com> <1505896805-12055-4-git-send-email-mszeredi@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1505896805-12055-4-git-send-email-mszeredi@redhat.com> User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1521 Lines: 42 On Wed, Sep 20, 2017 at 10:39:58AM +0200, Miklos Szeredi wrote: > The description of this flag says "Don't sync attributes with the server". > In other words: always use the attributes cached in the kernel and don't > send network or local messages to refresh the attributes. What is the use case for this AT_STATX_DONT_SYNC flag? I'm asking because the Coda userspace client potentially has attributes that are not cached in the kernel but can be (re-)validated without network communication. So if we just care about avoiding network traffic we could propagate the flag up to userspace. If we want to avoid context switches, disk I/O and only check on what happens to be cached in the kernel the current approach works fine. Jan > Signed-off-by: Miklos Szeredi > Cc: Jan Harkes > --- > fs/coda/inode.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/fs/coda/inode.c b/fs/coda/inode.c > index 6058df380cc0..734672b2cbdc 100644 > --- a/fs/coda/inode.c > +++ b/fs/coda/inode.c > @@ -255,7 +255,10 @@ static void coda_evict_inode(struct inode *inode) > int coda_getattr(const struct path *path, struct kstat *stat, > u32 request_mask, unsigned int flags) > { > - int err = coda_revalidate_inode(d_inode(path->dentry)); > + int err = 0; > + > + if (!(flags & AT_STATX_DONT_SYNC)) > + err = coda_revalidate_inode(d_inode(path->dentry)); > if (!err) > generic_fillattr(d_inode(path->dentry), stat); > return err; > -- > 2.5.5 > >