Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751666AbdITIkU (ORCPT ); Wed, 20 Sep 2017 04:40:20 -0400 Received: from mail-wr0-f173.google.com ([209.85.128.173]:52818 "EHLO mail-wr0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751284AbdITIkP (ORCPT ); Wed, 20 Sep 2017 04:40:15 -0400 X-Google-Smtp-Source: AOwi7QAAHYkuScZjt0DZ1Qe7wFKv+db0PwQU13ZuiMQ6XYM03vGHKkN0dIa674RSMbnR7A5tVSPpmQ== From: Miklos Szeredi To: linux-fsdevel@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Al Viro , David Howells , Bob Peterson , Steven Whitehouse Subject: [PATCH 05/10] gfs2: honor AT_STATX_DONT_SYNC Date: Wed, 20 Sep 2017 10:40:00 +0200 Message-Id: <1505896805-12055-6-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: 958 Lines: 27 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: Bob Peterson Cc: Steven Whitehouse --- fs/gfs2/inode.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c index 863749e29bf9..c59d36a3b724 100644 --- a/fs/gfs2/inode.c +++ b/fs/gfs2/inode.c @@ -1989,7 +1989,8 @@ static int gfs2_getattr(const struct path *path, struct kstat *stat, int error; gfs2_holder_mark_uninitialized(&gh); - if (gfs2_glock_is_locked_by_me(ip->i_gl) == NULL) { + if (!(flags & AT_STATX_DONT_SYNC) && + gfs2_glock_is_locked_by_me(ip->i_gl) == NULL) { error = gfs2_glock_nq_init(ip->i_gl, LM_ST_SHARED, LM_FLAG_ANY, &gh); if (error) return error; -- 2.5.5