Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp3109261imm; Fri, 19 Oct 2018 05:23:04 -0700 (PDT) X-Google-Smtp-Source: ACcGV60ov70FuBGDW0UyWZswVXQ6ut5EAgoPf/0aOCWzsZLtsDGZ2o9pxGG+kBF2CeiD8Pg/uP36 X-Received: by 2002:a62:1112:: with SMTP id z18-v6mr34446579pfi.200.1539951784421; Fri, 19 Oct 2018 05:23:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539951784; cv=none; d=google.com; s=arc-20160816; b=Bd9JMcGSO4Xljsrkt5D7Esnqj7g5u74lLSqonTcsJa4rKQI4qvuVR87D8g4BMsJpsV gOmphR9e+pMEnBg6mkuCXB4QbSAffsGQhtJOeGdo6yyMzNdL7njiAAWJQUQWtaIzBGSm 8E9Mq/WStjGKoY3yF8cXQhsw+aGIal6ozil719DE9yh+EdMS5UCtnLXYELLpWBN9+GSs zmRjaiRsQa61kLOA/zziRmhsMJ/bKmE1hWE/q/w6DnPHtLz9uzq/ngUG5OpigCbsdhzp VFIBF8GOKCJXTliZBCqYHbhYMxXzNoOVz4lOZSFnXlUW3diNV39cBZ0XMZBPDGMC4we4 E0bA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=5UiLIhWujnM+LjJO0qECMbozVNcKb22o+ATWjj/yvtc=; b=IJZRbvDk+60bdtiSI4mg4plC776eYVYyPtJMtFy9cSXepM/f86o/K3OqVBPPBcH9pG en1XtPeePmbAWCLpxmGFlYS+1O0Bxc4K34jOH2Lm/IeyZqDBTirw/iV/5A1JJblOhX6h LU8IFyR1dmVUcN3sprB33pu0hd1LVj7Avvi0VVFYMSpdyeQN9NmhAvKn144EFsETuxQ5 9gcH1JLjT+kYwfZ7mVDhix7Zp04cmS+prVpkH+NEhPJoxb4tgpuLW7v+lKauyji70C+9 ZmRgemXapo7ch0HsyXe7SgEttDrXx+YVixhFbdBdPWfXd2yayRU5cQqqxV1T57q4rcTz nxeg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a3-v6si22518914pgq.49.2018.10.19.05.22.48; Fri, 19 Oct 2018 05:23:04 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727213AbeJSU0r (ORCPT + 99 others); Fri, 19 Oct 2018 16:26:47 -0400 Received: from mail-wr1-f65.google.com ([209.85.221.65]:42722 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726647AbeJSU0q (ORCPT ); Fri, 19 Oct 2018 16:26:46 -0400 Received: by mail-wr1-f65.google.com with SMTP id r17-v6so4851954wrt.9 for ; Fri, 19 Oct 2018 05:20:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=5UiLIhWujnM+LjJO0qECMbozVNcKb22o+ATWjj/yvtc=; b=Gc97IzCrC2bTro8yGWPMlkEnBP3mwjf7fqcta8XdCeRXqsugRc+b3lXloJ3qL1a1Bh ponIMyH/cnJimocsz5+j3KQZ/T9KmYFuyuOpv/7r7lcTzcr28uLNqtPE76baQnD4Tj4/ G8Q1roCWIAIK+ZkqlNgcTtXUZGs+TzaGFO8JTJ2oSM6pq7oCDHd6qNWNy+6GkmuZDtNo cRrYQkUNaNb2Xmym4A1Wca9MXdUKD4dHdwTbmK2d24ynMf9pR3u5PXEdvOkkHGmP1TzK Xzui+iSeG/N9RZGXvGeLVsfGssQS/MWUA4k6Xq/BAKyl9uyJxPOz8FEPKEX7kWcVT+TP HQew== X-Gm-Message-State: ABuFfoiJGuYqXJUxTOZDVgwJ9ezYW7biT7E7x7T9TclimdQxZkk4JVOk doreEF8d/PK15aPRtJmVNUDLHA== X-Received: by 2002:adf:e18e:: with SMTP id k14-v6mr34944727wri.36.1539951654307; Fri, 19 Oct 2018 05:20:54 -0700 (PDT) Received: from veci.piliscsaba.redhat.com (catv-212-96-48-140.catv.broadband.hu. [212.96.48.140]) by smtp.gmail.com with ESMTPSA id s10-v6sm1858283wmf.15.2018.10.19.05.20.52 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 19 Oct 2018 05:20:53 -0700 (PDT) From: Miklos Szeredi To: linux-fsdevel@vger.kernel.org Cc: linux-kernel@vger.kernel.org, linux-api@vger.kernel.org, David Howells , Michael Kerrisk , Andreas Dilger , Florian Weimer , Amir Goldstein , Mike Marshall Subject: [PATCH v2 1/5] orangefs: fix request_mask misuse Date: Fri, 19 Oct 2018 14:20:45 +0200 Message-Id: <20181019122049.27121-1-mszeredi@redhat.com> X-Mailer: git-send-email 2.14.3 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Orangefs only handles STATX_BASIC_STATS in its getattr implementation, so mask off all other flags. Not doing so results in statx(2) forcing a refresh of cached attributes on any other requested flag (i.e. STATX_BTIME currently) due to the following test in orangefs_inode_getattr(): (request_mask & orangefs_inode->getattr_mask) == request_mask Also clean up gratuitous uses of STATX_ALL. Signed-off-by: Miklos Szeredi Reviewed-by: Martin Brandenburg Cc: Mike Marshall --- fs/orangefs/inode.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/fs/orangefs/inode.c b/fs/orangefs/inode.c index 31932879b716..bd7f15a831dc 100644 --- a/fs/orangefs/inode.c +++ b/fs/orangefs/inode.c @@ -256,7 +256,8 @@ 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); + ret = orangefs_inode_getattr(inode, 0, 0, + request_mask & STATX_BASIC_STATS); if (ret == 0) { generic_fillattr(inode, stat); @@ -408,7 +409,7 @@ struct inode *orangefs_iget(struct super_block *sb, if (!inode || !(inode->i_state & I_NEW)) return inode; - error = orangefs_inode_getattr(inode, 1, 1, STATX_ALL); + error = orangefs_inode_getattr(inode, 1, 1, STATX_BASIC_STATS); if (error) { iget_failed(inode); return ERR_PTR(error); @@ -453,7 +454,7 @@ struct inode *orangefs_new_inode(struct super_block *sb, struct inode *dir, orangefs_set_inode(inode, ref); inode->i_ino = hash; /* needed for stat etc */ - error = orangefs_inode_getattr(inode, 1, 1, STATX_ALL); + error = orangefs_inode_getattr(inode, 1, 1, STATX_BASIC_STATS); if (error) goto out_iput; -- 2.14.3