From patchwork Thu Apr 12 15:08:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miklos Szeredi X-Patchwork-Id: 10338757 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 79C85604D4 for ; Thu, 12 Apr 2018 15:17:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7070B2434C for ; Thu, 12 Apr 2018 15:17:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 64F7D25D9E; Thu, 12 Apr 2018 15:17:38 +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 12CC02434C for ; Thu, 12 Apr 2018 15:17:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754050AbeDLPMq (ORCPT ); Thu, 12 Apr 2018 11:12:46 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:38335 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753622AbeDLPJA (ORCPT ); Thu, 12 Apr 2018 11:09:00 -0400 Received: by mail-wm0-f68.google.com with SMTP id i3so10172933wmf.3 for ; Thu, 12 Apr 2018 08:09:00 -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=MyIhq78uy0YO6rxAZmxPdIUDWbJQ7eCG86GRo6ABgFo=; b=WERYuGUdq+iy782PAsgIsLwCoouNfKORnk1mgy2JXetQMyqDBF8ekrutd1xj1qnA4O V4cFtMFIaz1nLuTNGwkEloBV4trL2uspTPZ58hsOXEXOL2Jx3xoQqO3f+q0vdEZkGz13 J6zzVsmLbVtgVxHrNdO9E+SppQVTGI6z0ZsSd6E3t0cEER3tQC73GQOjKyhIK+x//s1n 1mBxXUgo1vH5ggJm4EOapmTmm47IxZfTIo3twJrbRVucfelTNcjlnyeISgmmsc+Dgu1u wy3aYVyNzH4H3Gg06Sj22utl0Hz19t0eA8bV56qcOuTlzILJ8WFhMSa7RstWlG+H/OZE i7pA== X-Gm-Message-State: ALQs6tATZ4D4v0x8q40EE+hYsQvl6PCIct+R2Ne5x4U1M6R0dbw5NQfV G4OIBUlwoyaRyUIuykRexFZYgH92jtk= X-Google-Smtp-Source: AIpwx4/ZnSBr9Mih/ateC1gGC7hafFzZ+yU3LYTeJOOtxWPiWd1xbrPb94MzLTKNLqK3kOpYNj8V7w== X-Received: by 10.28.45.200 with SMTP id t191mr981151wmt.7.1523545739575; Thu, 12 Apr 2018 08:08:59 -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 p197sm2621783wme.43.2018.04.12.08.08.58 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 12 Apr 2018 08:08:59 -0700 (PDT) From: Miklos Szeredi To: linux-unionfs@vger.kernel.org Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RFC PATCH 24/35] Revert "ovl: fix relatime for directories" Date: Thu, 12 Apr 2018 17:08:15 +0200 Message-Id: <20180412150826.20988-25-mszeredi@redhat.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180412150826.20988-1-mszeredi@redhat.com> References: <20180412150826.20988-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 ef362364d396..163715de8cb2 100644 --- a/fs/inode.c +++ b/fs/inode.c @@ -1570,24 +1570,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 82a99d366aec..4c7ab11c627a 100644 --- a/include/linux/dcache.h +++ b/include/linux/dcache.h @@ -565,9 +565,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