From patchwork Mon May 7 08:38:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miklos Szeredi X-Patchwork-Id: 10383455 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 49EA26037F for ; Mon, 7 May 2018 08:39:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3DDF528A96 for ; Mon, 7 May 2018 08:39:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 327E328B3E; Mon, 7 May 2018 08:39:32 +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=-7.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham 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 C09DA28A96 for ; Mon, 7 May 2018 08:39:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752189AbeEGIjZ (ORCPT ); Mon, 7 May 2018 04:39:25 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:39083 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752231AbeEGIip (ORCPT ); Mon, 7 May 2018 04:38:45 -0400 Received: by mail-wm0-f66.google.com with SMTP id f8-v6so13832128wmc.4 for ; Mon, 07 May 2018 01:38:45 -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=He7/cXJzAEWO0mDS1kknE8KCxFxCrMw+aRlepPL2vDA=; b=SYFG5msHBEuZAown6z8hoLI/0aHj+NhjfY+LdKtSiF80mmNZFk8ie4qBDZgR0VaiPG L6392o/czGGSkxvJ+SFNS3GFnNLjn/WZFJU1+lKfydiJVzNe6yxpo3MNjFBxW3k60tTI teljAyIKuilB8AY4yYWSqoCBSWqKmCfmPXK3ixFRiwS9lLNtwPtmyc3tbV3HNlYMYJxq 83or+tuZ3mjpKujjRD2Gy6Mur0i/T5Yfi7yRm2Gd/XUwWtrd0aFeLL4R1v4zJpDgoUMA Nm7LN8f5vnOi31LcUtToyKmF2gxfxRvjC8mtVlz5CI3SvGalV7MMFxBwi3CYAsgXtswm YwCw== X-Gm-Message-State: ALKqPwdGzhnvrYwJodjG6U9Bc0coF76TvoQYQ6BA7e1XGDX+jwk5AKmj uknRDihbVpz++JCPt4vPZ04pAA== X-Google-Smtp-Source: AB8JxZqB+EnDI7wXPeDSnXx9IyXNiXPbSWZhsu0G7Sb7lNcu5RPEU9OTw0Encwgy3/YnJ63opK0ACw== X-Received: by 10.28.168.77 with SMTP id r74mr187164wme.114.1525682324455; Mon, 07 May 2018 01:38:44 -0700 (PDT) Received: from veci.piliscsaba.redhat.com (C2B0E321.catv.pool.telekom.hu. [194.176.227.33]) by smtp.gmail.com with ESMTPSA id h8-v6sm5908050wmc.16.2018.05.07.01.38.43 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 07 May 2018 01:38:43 -0700 (PDT) From: Miklos Szeredi To: linux-unionfs@vger.kernel.org Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Al Viro Subject: [PATCH v2 28/35] Revert "ovl: fix relatime for directories" Date: Mon, 7 May 2018 10:38:00 +0200 Message-Id: <20180507083807.28792-29-mszeredi@redhat.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180507083807.28792-1-mszeredi@redhat.com> References: <20180507083807.28792-1-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 This reverts commit cd91304e7190b4c4802f8e413ab2214b233e0260. Overlayfs no longer relies on the vfs correct atime handling. Signed-off-by: Miklos Szeredi --- fs/inode.c | 21 ++++----------------- fs/overlayfs/super.c | 3 --- include/linux/dcache.h | 3 --- 3 files changed, 4 insertions(+), 23 deletions(-) diff --git a/fs/inode.c b/fs/inode.c index 13ceb98c3bd3..e97d0193221d 100644 --- a/fs/inode.c +++ b/fs/inode.c @@ -1573,24 +1573,11 @@ EXPORT_SYMBOL(bmap); static void update_ovl_inode_times(struct dentry *dentry, struct inode *inode, bool rcu) { - struct dentry *upperdentry; + if (!rcu) { + struct inode *realinode = d_real_inode(dentry); - /* - * Nothing to do if in rcu or if non-overlayfs - */ - if (rcu || likely(!(dentry->d_flags & DCACHE_OP_REAL))) - return; - - upperdentry = d_real(dentry, NULL, 0, D_REAL_UPPER); - - /* - * If file is on lower then we can't update atime, so no worries about - * stale mtime/ctime. - */ - if (upperdentry) { - struct inode *realinode = d_inode(upperdentry); - - if ((!timespec_equal(&inode->i_mtime, &realinode->i_mtime) || + if (unlikely(inode != realinode) && + (!timespec_equal(&inode->i_mtime, &realinode->i_mtime) || !timespec_equal(&inode->i_ctime, &realinode->i_ctime))) { inode->i_mtime = realinode->i_mtime; inode->i_ctime = realinode->i_ctime; diff --git a/fs/overlayfs/super.c b/fs/overlayfs/super.c index c3d8c7ea180f..006dc70d7425 100644 --- a/fs/overlayfs/super.c +++ b/fs/overlayfs/super.c @@ -107,9 +107,6 @@ static struct dentry *ovl_d_real(struct dentry *dentry, if (inode && d_inode(dentry) == inode) return dentry; - if (flags & D_REAL_UPPER) - return ovl_dentry_upper(dentry); - if (!d_is_reg(dentry)) { if (!inode || inode == d_inode(dentry)) return dentry; diff --git a/include/linux/dcache.h b/include/linux/dcache.h index 94acbde17bb1..b2b829bcb7c0 100644 --- a/include/linux/dcache.h +++ b/include/linux/dcache.h @@ -563,9 +563,6 @@ static inline struct dentry *d_backing_dentry(struct dentry *upper) return upper; } -/* d_real() flags */ -#define D_REAL_UPPER 0x2 /* return upper dentry or NULL if non-upper */ - /** * d_real - Return the real dentry * @dentry: the dentry to query