Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751732AbdITIkZ (ORCPT ); Wed, 20 Sep 2017 04:40:25 -0400 Received: from mail-wr0-f172.google.com ([209.85.128.172]:45469 "EHLO mail-wr0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751284AbdITIkV (ORCPT ); Wed, 20 Sep 2017 04:40:21 -0400 X-Google-Smtp-Source: AOwi7QBj/PI9EMlbX4TeQWCc+4wfEc46eOOOM892F2L50EEDPPrcGY/AmLfhJBiI97oCnCgNfHaYYA== From: Miklos Szeredi To: linux-fsdevel@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Al Viro , David Howells , Mike Marshall Subject: [PATCH 09/10] orangefs: honor AT_STATX_DONT_SYNC Date: Wed, 20 Sep 2017 10:40:04 +0200 Message-Id: <1505896805-12055-10-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: 1246 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: Mike Marshall --- fs/orangefs/inode.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fs/orangefs/inode.c b/fs/orangefs/inode.c index 9428ea0aac16..1b3c4c4dd3d4 100644 --- a/fs/orangefs/inode.c +++ b/fs/orangefs/inode.c @@ -247,7 +247,7 @@ int orangefs_setattr(struct dentry *dentry, struct iattr *iattr) int orangefs_getattr(const struct path *path, struct kstat *stat, u32 request_mask, unsigned int flags) { - int ret = -ENOENT; + int ret = 0; struct inode *inode = path->dentry->d_inode; struct orangefs_inode_s *orangefs_inode = NULL; @@ -255,7 +255,9 @@ int orangefs_getattr(const struct path *path, struct kstat *stat, "orangefs_getattr: called on %pd\n", path->dentry); - ret = orangefs_inode_getattr(inode, 0, 0, request_mask); + if (!(flags & AT_STATX_DONT_SYNC)) + ret = orangefs_inode_getattr(inode, 0, 0, request_mask); + if (ret == 0) { generic_fillattr(inode, stat); -- 2.5.5