Received: by 10.192.165.156 with SMTP id m28csp481916imm; Fri, 13 Apr 2018 02:34:32 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/HRpOuAyhOIQYWfIspZPjAS3PqRbOVUuYTt/ryV/xkFfys2CSVGwRoeiz7Rd1FFISGpIYk X-Received: by 2002:a17:902:8e83:: with SMTP id bg3-v6mr4521510plb.144.1523612072283; Fri, 13 Apr 2018 02:34:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523612072; cv=none; d=google.com; s=arc-20160816; b=gkyS+oJJWSl+bRfzIlOF+oirJWjxLS6nfzMrfR7kg7ZF27LzB6LDweYsigu3U8ZcfL UWEw9KAiNtbLKw0VrzX4BliomQM95X5Me8vgW3xcviDGXjgq8wv8WlKegXZy4XrdezqW KQlBouAKkts5vFFZbGWuwb4sIn592X3zKXccyZYSJpJZXPtYGF3Jaz8LitCASMmZbLN3 5zZWJf2ZSSvZ/9bmfZ3VPUy3qxgA7XPKGnq1ygf33FGp2McYMiEjdxrn72xAN4mqyWdA oQa2H0Bbfh7+/xUfd3sdOGQ+WEYVhfhRKxiOJ0Hmdjm6TDGsOj2C5SWEbBg6BX1AE5lF sapA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=x2Po+5Vsm6Rbc+wVEXLKrIco9+RGC8tnOoPzPZNqd/8=; b=ak0iolDu+k7cOFAgyJ+NQ3UnW8vLXCXB8Ya08lnzuq8IH2zoWJdBW8Q3D/Ab+wTukz Ylg3CfJHp5Hw3mXWnyZhowiYN0eCGAXh1GOZfduItaxu3yg9f7rUl7S5V6CO3eFqgFcj 1m2ui20PM+qslSTX3j68QHbvzuUgjVrgB1Da3h3yzLBKYWXf1m3qvNdY9Onc5IdJhEVP lsZpfzJeN9HiJsZA6LPY3REwhZCUtcn5NMzpTmJtvpDKqJNOY4UQDhSfI1IcVHhMHp3+ elp5+893JNSv37KhIJVoDbO7Br+3mn8x+5YdhrHL5wJz48qbD2DvOupuUTT2qL4L4+YG RIdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=oE2Pyzwy; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o32-v6si5174274pld.320.2018.04.13.02.34.12; Fri, 13 Apr 2018 02:34:32 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=oE2Pyzwy; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754076AbeDMIZ3 (ORCPT + 99 others); Fri, 13 Apr 2018 04:25:29 -0400 Received: from mail-yb0-f174.google.com ([209.85.213.174]:45489 "EHLO mail-yb0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753001AbeDMIZY (ORCPT ); Fri, 13 Apr 2018 04:25:24 -0400 Received: by mail-yb0-f174.google.com with SMTP id k199-v6so4102250ybk.12; Fri, 13 Apr 2018 01:25:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=x2Po+5Vsm6Rbc+wVEXLKrIco9+RGC8tnOoPzPZNqd/8=; b=oE2PyzwyaykE4pQz6NyaGDui0Y7lZ3QZquqps8KthHFf5RP7f2vwjIjqjfqjetXkl7 kil01WrqqtOMZGvRHcGzxd9pOp4b6Xu0sN6iO5ApE61kx4OxK796+x2iKk3qeY5Kh5la d4B//4Ugitr8waUt1HwGYVN7MZ8gY+50sWdwoO3Fcss642sW1LoeF9lMi7ydLDx/bSyD gkHBWMpAhKeWLq/etsi+/flDdtcls4G4kD3eDwAr3pzYAcmqCOi98QkcfUktTqNZcgGs zQTIMsjKe44DtPUee6xC6G1SYfx+QIF8ehmv36gASeU9mO6AIRie+eGmTiEmuXh75GM6 SwbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=x2Po+5Vsm6Rbc+wVEXLKrIco9+RGC8tnOoPzPZNqd/8=; b=VNbgRbJsGvl1ZG5yJrfz4La8P8j2Q5hJFtkNSZ/QNyAfkt/A0fhAoyPKF25JlTSPs4 Pfy3tWrfSSMoSqlcD+jYjUT7Pg7h0Z6XEV5BNThhxE5aLlEnmi846TiUQxYQzDYpCklx 7b4hKbhm2ftOKRsK3HcTg+ZKrYzYelJ8XnS+yG8e2s2MrLgyCCnvdal+EHRtf0LT5Cdx GBq8+XJXd+Mf8nCJtG/VnXWsqG8mk+JatCAc//x4YsQhLiNXeNzfGNS9QUjr39BViFlg 2Z/swe4arhesc0v5Ov5osXotxRIg8IsmfmxOArZ8BXW6/ZtIXMYMPVYyseCThrh9rMhM BZmA== X-Gm-Message-State: ALQs6tD+5ukmCUf4nMrBqkE7bPGtwNEoMf2hctZCsutOxz4qCt8PvVW+ NjXTRc+iwf5o+HV3N3e1XK5LS4k3LOl/8TNH2vo= X-Received: by 2002:a25:2d43:: with SMTP id s3-v6mr3816121ybe.475.1523607923892; Fri, 13 Apr 2018 01:25:23 -0700 (PDT) MIME-Version: 1.0 Received: by 10.129.183.12 with HTTP; Fri, 13 Apr 2018 01:25:23 -0700 (PDT) In-Reply-To: <20180412150826.20988-5-mszeredi@redhat.com> References: <20180412150826.20988-1-mszeredi@redhat.com> <20180412150826.20988-5-mszeredi@redhat.com> From: Amir Goldstein Date: Fri, 13 Apr 2018 11:25:23 +0300 Message-ID: Subject: Re: [RFC PATCH 04/35] ovl: copy up times To: Miklos Szeredi Cc: overlayfs , linux-fsdevel , linux-kernel Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 12, 2018 at 6:07 PM, Miklos Szeredi wrote: > Copy up mtime and ctime to overlay inode after times in real object are > modified. Be careful not to dirty cachelines when not necessary. > > This is in preparation for moving overlay functionality out of the VFS. > > This patch shouldn't have any observable effect. > > Signed-off-by: Miklos Szeredi > --- > fs/overlayfs/dir.c | 5 +++++ > fs/overlayfs/inode.c | 1 + > fs/overlayfs/overlayfs.h | 7 +++++++ > fs/overlayfs/util.c | 19 +++++++++++++++++++ > 4 files changed, 32 insertions(+) > > diff --git a/fs/overlayfs/dir.c b/fs/overlayfs/dir.c > index 839709c7803a..cd0fa2363723 100644 > --- a/fs/overlayfs/dir.c > +++ b/fs/overlayfs/dir.c > @@ -507,6 +507,7 @@ static int ovl_create_or_link(struct dentry *dentry, struct inode *inode, > else > err = ovl_create_over_whiteout(dentry, inode, attr, > hardlink); > + ovl_copytimes_with_parent(dentry); > } > out_revert_creds: > revert_creds(old_cred); > @@ -768,6 +769,7 @@ static int ovl_do_remove(struct dentry *dentry, bool is_dir) > drop_nlink(dentry->d_inode); > } > ovl_nlink_end(dentry, locked); > + ovl_copytimes_with_parent(dentry); > out_drop_write: > ovl_drop_write(dentry); > out: > @@ -1079,6 +1081,9 @@ static int ovl_rename(struct inode *olddir, struct dentry *old, > ovl_dentry_version_inc(new->d_parent, ovl_type_origin(old) || > (d_inode(new) && ovl_type_origin(new))); > > + ovl_copytimes_with_parent(old); > + ovl_copytimes_with_parent(new); > + All the ovl_copytimes_with_parent() calls you added can be replaced with a single call in ovl_dentry_version_inc(). Just need to change its name and pass it the child instead of the parent dentry. Thanks, Amir.