From patchwork Tue May 29 14:43:33 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miklos Szeredi X-Patchwork-Id: 10436069 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 D3DA4601C7 for ; Tue, 29 May 2018 15:10:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BCDE128845 for ; Tue, 29 May 2018 15:10:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B147028846; Tue, 29 May 2018 15:10:23 +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=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 5CF5A28852 for ; Tue, 29 May 2018 15:10:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936529AbeE2PJF (ORCPT ); Tue, 29 May 2018 11:09:05 -0400 Received: from mail-wr0-f193.google.com ([209.85.128.193]:36412 "EHLO mail-wr0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935828AbeE2OoX (ORCPT ); Tue, 29 May 2018 10:44:23 -0400 Received: by mail-wr0-f193.google.com with SMTP id f16-v6so10649013wrm.3 for ; Tue, 29 May 2018 07:44:22 -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=69uxzQVZQx6JoN5ZsiAWRKZ91gr53JCL3ISC9tEOZ78=; b=FUgNi26JwQiKke+q6ELcIsFioc5Sc6IRije2ummSjLJ2W2Q11m18B+17Kvvsr/1Pop m30Q8+fyuigAuMvmjHsLLadw2O52zlV4y5w+M1DRRHWCXK7amxFBkUahYUuE3ufjgLv9 q/dwhVbNYxNER52pp6U50iLLuQ1uYfU91g1Z74VQ4YP8ZBRFqiIovLrrTeG/HZpKDS4d CgnQw64M5rd+DrKzUCgmliDcrkyNpNy6dscZJzAix2HikFTvXchTdQD/z2//WLepJW+W bUY6WVBe1QbZbEvS6bpn1+J/gTWEEnkQW4I2HtzXwKIj+zuTdiGOmExWMFRqENNPZefu uesw== X-Gm-Message-State: ALKqPwfWecq1mToaQ56aCYQo81LA/8z5QL4y3FKCt34JviiNscU6ArD5 vqGnc/pHQpDBkOp2/LXENacWXA== X-Google-Smtp-Source: AB8JxZqjORlUJeLZTi+N5I50W/PESaHpqNYzk+NdJdUaf1XH0VTuV1oBFJgnKm07ImLT/Y7lG1P+oQ== X-Received: by 2002:adf:be81:: with SMTP id i1-v6mr13458160wrh.86.1527605062130; Tue, 29 May 2018 07:44:22 -0700 (PDT) Received: from veci.piliscsaba.redhat.com (catv-176-63-54-97.catv.broadband.hu. [176.63.54.97]) by smtp.gmail.com with ESMTPSA id t198-v6sm18834422wmt.23.2018.05.29.07.44.21 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 29 May 2018 07:44:21 -0700 (PDT) From: Miklos Szeredi To: linux-unionfs@vger.kernel.org Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 33/39] Revert "ovl: fix relatime for directories" Date: Tue, 29 May 2018 16:43:33 +0200 Message-Id: <20180529144339.16538-34-mszeredi@redhat.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180529144339.16538-1-mszeredi@redhat.com> References: <20180529144339.16538-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 1bea65d37afe..ad0259bafe2d 100644 --- a/fs/inode.c +++ b/fs/inode.c @@ -1559,24 +1559,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 900ed4c39919..65ec661c60e6 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 66c6e17e61e5..ddae4103d324 100644 --- a/include/linux/dcache.h +++ b/include/linux/dcache.h @@ -564,9 +564,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