From patchwork Wed Sep 20 08:39:56 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miklos Szeredi X-Patchwork-Id: 9961145 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 99481601D5 for ; Wed, 20 Sep 2017 08:44:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8C76929029 for ; Wed, 20 Sep 2017 08:44:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8177E2902D; Wed, 20 Sep 2017 08:44:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.4 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 21DC029029 for ; Wed, 20 Sep 2017 08:44:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751739AbdITInp (ORCPT ); Wed, 20 Sep 2017 04:43:45 -0400 Received: from mail-wm0-f52.google.com ([74.125.82.52]:49872 "EHLO mail-wm0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751463AbdITIkK (ORCPT ); Wed, 20 Sep 2017 04:40:10 -0400 Received: by mail-wm0-f52.google.com with SMTP id e71so5006010wmg.4 for ; Wed, 20 Sep 2017 01:40:09 -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:in-reply-to :references; bh=b9OHPbP4JzYSV4E6o3OAKHR9JDMz2Txm6r/AoSlDVhg=; b=cCzeWDi4NQPFVQlGYdFSPcWVLQQOedoTj6IYiWtQJBGmSVB8EZh/vHlBn2f0OBB5CU kqCOUdS6PMpILjoCj3/Zvyjb1gTqtWj2lHuNdfjqPMVALinZjQZ2G2rDTWSn/ycnM+5I IeF1JMrisLREI0fS+mMWnDkwVPW4I9CnaffXfS9mYGrtmZ/ejzdmZPbU+EV3hYUwgdSt KiR3kjNA0Io6BIBTXxlJ3D0pNDoRbrtOoG2QUJ1FBXaU6gplu7tjWsoGddhhO0bugAf0 yH+uEissa0q+ubl3a9HyL3+fGbBe4SvbxnCmb4oY/AaFyW6ZE7iRbAL6ZoJ0ZLgg5QEI RQvQ== X-Gm-Message-State: AHPjjUgPDKaKPxnNjzH5By2b0R9+uAP1ZAqij+n+Pm0GoD0CL5tnbAK6 /JRwFpE5jGndqoEtc3A6BsD60piIpJ4= X-Google-Smtp-Source: AOwi7QAZ6T0QooT1APM9wM9OlaoJ0OSzQv+S5i7b2E/8r8fgg9JhFj+ioe9CMORLXYHtIeZjnkFuYw== X-Received: by 10.28.61.139 with SMTP id k133mr3025006wma.84.1505896809141; Wed, 20 Sep 2017 01:40:09 -0700 (PDT) Received: from veci.piliscsaba.szeredi.hu (20014C4C1ADF62001A5E0FFFFEAE9246.catv.pool.telekom.hu. [2001:4c4c:1adf:6200:1a5e:fff:feae:9246]) by smtp.gmail.com with ESMTPSA id h29sm1188422wrf.76.2017.09.20.01.40.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 20 Sep 2017 01:40:08 -0700 (PDT) From: Miklos Szeredi To: linux-fsdevel@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Al Viro , David Howells , Ilya Dryomov , "Yan, Zheng" , Sage Weil Subject: [PATCH 01/10] ceph: honor AT_STATX_DONT_SYNC Date: Wed, 20 Sep 2017 10:39:56 +0200 Message-Id: <1505896805-12055-2-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-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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: Ilya Dryomov Cc: "Yan, Zheng" Cc: Sage Weil --- fs/ceph/inode.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c index 373dab5173ca..723002f6b060 100644 --- a/fs/ceph/inode.c +++ b/fs/ceph/inode.c @@ -2201,9 +2201,11 @@ int ceph_getattr(const struct path *path, struct kstat *stat, { struct inode *inode = d_inode(path->dentry); struct ceph_inode_info *ci = ceph_inode(inode); - int err; + int err = 0; + + if (!(flags & AT_STATX_DONT_SYNC)) + err = ceph_do_getattr(inode, CEPH_STAT_CAP_INODE_ALL, false); - err = ceph_do_getattr(inode, CEPH_STAT_CAP_INODE_ALL, false); if (!err) { generic_fillattr(inode, stat); stat->ino = ceph_translate_ino(inode->i_sb, inode->i_ino);