Received: by 10.192.165.156 with SMTP id m28csp2080652imm; Thu, 12 Apr 2018 08:17:43 -0700 (PDT) X-Google-Smtp-Source: AIpwx48CzDe2HxVGFroBriIbTLtcatp5+ofkwtwnCmp2wDgjdHsuFwjeYZ38SqxKDvByIQctjkEh X-Received: by 2002:a17:902:6909:: with SMTP id j9-v6mr1513663plk.92.1523546263550; Thu, 12 Apr 2018 08:17:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523546263; cv=none; d=google.com; s=arc-20160816; b=MR3oqLCXAzAEneh+QJvBqR8ShBq6i6oLnPbWo8jSezqcVCcltfyQSDuofuPFrOL8Sa 4NyuHyNHaUzHpBCdB3czC6ciPJIERjtwcjcnRY07FsdkwP3zU+mS5LdkFKAh3S0oD/5j jUIbK3r6oIq+VprG6KBefKK3aDT+10ipmHt23fHMpUvc9IoKT0gu+KFzGQUGxbncTPWD TdmjELPMcJnqr+xXkC/l535m1IBYkTMu8KMnxeJ0IWqN7Wj0twRDzn5RO4KzvtRIbSIt zB17kix5LQ2o9vcjg5vvookzWh2y1m82F1f+wb1JJbdOmowoVL09l3Fe7tSXSJb/LNAI eHwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=MyIhq78uy0YO6rxAZmxPdIUDWbJQ7eCG86GRo6ABgFo=; b=d3USqHIYALa7vfXQptUhugoOLPbb5nPwgnuQcbXPhHf7ufJgzGYN9X3zMn12P0Gfia GwKYbdZwT0E4N+X0PGT2SNLSnc+3TYHmy/G3BHR6zI8fWHxw91Av1fdCC4my7RnxCi25 sUX0EmBFr8A1EicIiZf+X//9qBd5VcetYFi+2jdP70GUgz6JxB92CHrDAnRsMvsYogBu +qUTDAxjMW2gLRIJSj+tBo7qjiR//65ub6mMWWOEe7Yv09ifSHVt/nLTnqocmVjpEpBu pkc0S9QLH3Jfjtag/NGK3UEyoyCLw7VABeUyyMfuDdwhjytmCbASzdfRe7PUJF3/47pi Ts9w== 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 k63si2784050pfh.372.2018.04.12.08.17.06; Thu, 12 Apr 2018 08:17:43 -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 S1754056AbeDLPMq (ORCPT + 99 others); Thu, 12 Apr 2018 11:12:46 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:55605 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753621AbeDLPJA (ORCPT ); Thu, 12 Apr 2018 11:09:00 -0400 Received: by mail-wm0-f65.google.com with SMTP id b127so12429082wmf.5 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=TQQWAO6RCNJu/sv0oSWMzyi5yrj1xFy7LxjWL59h2o7B2+TtEni6xUgk42Mpi6Aq15 VJxhKhnqvJDepoHBmxA8j0//niC8zZs9r6waccCbbFzD4VCu3MOigdGsekxIZHwIKpdd e81Iyv4cHv8dV+ZlHkY2HfFOYgUJoXxmNcKX61CUmEWnS9cogFZT7NHRy8dUf01w614w WsrZJ0nMMcbiXad10GRm5CoqVoijTmC2giHgOhczz5Ocqx09s8a+dy7k6/2/HXCGwkJ9 W8HeRNR8zQbM//Xr1zcSIU+rKQeqLUJw1eZd1/J9M4vwwANAlRX5V1mnr9vmmlSxaQNv ojUQ== X-Gm-Message-State: ALQs6tDSlTg80ApCemzMNo+t57murLtXhnhqDDggNSKHtD7FxOLc61fR UAyVehf1lUg1jNEGrtOoG4oIRw== 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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 -- 2.14.3