Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751830AbdITIlM (ORCPT ); Wed, 20 Sep 2017 04:41:12 -0400 Received: from mail-wr0-f174.google.com ([209.85.128.174]:53466 "EHLO mail-wr0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751646AbdITIkT (ORCPT ); Wed, 20 Sep 2017 04:40:19 -0400 X-Google-Smtp-Source: AOwi7QAGoT2XonIOztA5ZAybnEaVygy1F5+GZMXtDhe0ONq5EOa4Al/+kRMnx272wHUPnlgn/zHbYw== From: Miklos Szeredi To: linux-fsdevel@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Al Viro , David Howells , Mark Fasheh , Joel Becker Subject: [PATCH 08/10] ocfs2: honor AT_STATX_DONT_SYNC Date: Wed, 20 Sep 2017 10:40:03 +0200 Message-Id: <1505896805-12055-9-git-send-email-mszeredi@redhat.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1505896805-12055-1-git-send-email-mszeredi@redhat.com> References: <1505896805-12055-1-git-send-email-mszeredi@redhat.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1029 Lines: 36 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: Mark Fasheh Cc: Joel Becker --- fs/ocfs2/file.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c index 6e41fc8fabbe..2d248d71c275 100644 --- a/fs/ocfs2/file.c +++ b/fs/ocfs2/file.c @@ -1307,11 +1307,13 @@ int ocfs2_getattr(const struct path *path, struct kstat *stat, struct ocfs2_super *osb = sb->s_fs_info; int err; - err = ocfs2_inode_revalidate(path->dentry); - if (err) { - if (err != -ENOENT) - mlog_errno(err); - goto bail; + if (!(flags & AT_STATX_DONT_SYNC)) { + err = ocfs2_inode_revalidate(path->dentry); + if (err) { + if (err != -ENOENT) + mlog_errno(err); + goto bail; + } } generic_fillattr(inode, stat); -- 2.5.5