Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751851AbdIUSOb (ORCPT ); Thu, 21 Sep 2017 14:14:31 -0400 Received: from mail-pg0-f68.google.com ([74.125.83.68]:33963 "EHLO mail-pg0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751687AbdIUSO2 (ORCPT ); Thu, 21 Sep 2017 14:14:28 -0400 X-Google-Smtp-Source: AOwi7QDUXvPM8APpvpCLcEyZD7VLV2xhIv29utazWJxINH0F+a+LQCMX5Dq7wfeyciQ6HS5nPIuBaFUjy9MdilYwAk4= MIME-Version: 1.0 In-Reply-To: <1505896805-12055-3-git-send-email-mszeredi@redhat.com> References: <1505896805-12055-1-git-send-email-mszeredi@redhat.com> <1505896805-12055-3-git-send-email-mszeredi@redhat.com> From: Steve French Date: Thu, 21 Sep 2017 13:14:07 -0500 Message-ID: Subject: Re: [PATCH 02/10] cifs: honor AT_STATX_DONT_SYNC To: Miklos Szeredi Cc: linux-fsdevel , LKML , Al Viro , David Howells , Steve French Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2345 Lines: 66 Do you have any sample program/code to query with this flag? On Wed, Sep 20, 2017 at 3:39 AM, 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. > > Signed-off-by: Miklos Szeredi > Cc: Steve French > --- > fs/cifs/inode.c | 30 ++++++++++++++++-------------- > 1 file changed, 16 insertions(+), 14 deletions(-) > > diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c > index a8693632235f..982ba2e4f549 100644 > --- a/fs/cifs/inode.c > +++ b/fs/cifs/inode.c > @@ -2003,22 +2003,24 @@ int cifs_getattr(const struct path *path, struct kstat *stat, > struct inode *inode = d_inode(dentry); > int rc; > > - /* > - * We need to be sure that all dirty pages are written and the server > - * has actual ctime, mtime and file length. > - */ > - if (!CIFS_CACHE_READ(CIFS_I(inode)) && inode->i_mapping && > - inode->i_mapping->nrpages != 0) { > - rc = filemap_fdatawait(inode->i_mapping); > - if (rc) { > - mapping_set_error(inode->i_mapping, rc); > - return rc; > + if (!(flags & AT_STATX_DONT_SYNC)) { > + /* > + * We need to be sure that all dirty pages are written and the > + * server has actual ctime, mtime and file length. > + */ > + if (!CIFS_CACHE_READ(CIFS_I(inode)) && inode->i_mapping && > + inode->i_mapping->nrpages != 0) { > + rc = filemap_fdatawait(inode->i_mapping); > + if (rc) { > + mapping_set_error(inode->i_mapping, rc); > + return rc; > + } > } > - } > > - rc = cifs_revalidate_dentry_attr(dentry); > - if (rc) > - return rc; > + rc = cifs_revalidate_dentry_attr(dentry); > + if (rc) > + return rc; > + } > > generic_fillattr(inode, stat); > stat->blksize = CIFS_MAX_MSGSIZE; > -- > 2.5.5 > -- Thanks, Steve