Message ID | 20230612104524.17058-4-jlayton@kernel.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp2508565vqr; Mon, 12 Jun 2023 04:16:23 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ52VQM8hf6lXsZZDR/XQXvr4W4shX9ZddQaQa2XTFEUcGLXXhRzROurn/BTNan204IrTUFm X-Received: by 2002:a05:6808:19a5:b0:398:342a:f491 with SMTP id bj37-20020a05680819a500b00398342af491mr4475565oib.34.1686568583176; Mon, 12 Jun 2023 04:16:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686568583; cv=none; d=google.com; s=arc-20160816; b=JjqVAzCy0ZyDNacOCRapWLTYOIlJ9jN1EL2w4a7SHX1Px5SwuOMLrEp3ZQHVlUpdqn k2vQKknXgI+Tluqs8/B8ONXFiisoHhfCrdQK4hbX/t6ji/rUOaqZNHzzaTlhkiHRFf0q uqlgYaUvqdu2Vjji+KdYd74yfPzbHZbKNCtCSK/AYG1fPPXGI2uAmCM2awpMDKYuG/y0 uvn5paFXFmxyXjvPox+UtMQn/TZ6nDSvObjdXm8xwTjOizYy6TMb0c7+r/bGJvwSu5nu ixZJnrPsEN+UUbJXVV/o2gVpyMu7a78z/sFbPOgsqMe5MHjk5J+S0Ld0naHBEMsLnno8 QCfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=3MjDvwzK4mu9jxSf97gvBFK/y6YdeFO8Sr9n3S/PTvQ=; b=X0LuXiukyFXTLpgAGI+jNSdR7uNlh1mfLuKuQawObfP/ubNl2ZZFg03+aVDZi2So5I oyIkPk/YAL+xN0UeQy1zCGYJIAWAnjBsBtpJn/OfnzrA8+6W1E77NKsg3kVAsc5VGVQ7 btKqiUOTxR+1b9AXypWFLo8m52uXavFtWLenN9q3REnTYsog1fuW4FOwdDcvea9fbBIg iCXdonI5hvZOn7LL9gxGBdHWyKk2xho3+jY0KIEGa7olFVve9S++3COSskFUzEDD6tk9 X/YXgMeYXs9llLyuLLtm2XIBV/9idxmmYQOqOzMCG6vWuJK18wNyVzASoJiH0mtkXlkK ZjnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=VNA1yc1Y; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h7-20020a17090a710700b0025c038134aasi68450pjk.163.2023.06.12.04.16.09; Mon, 12 Jun 2023 04:16:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=VNA1yc1Y; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237036AbjFLK6E (ORCPT <rfc822;rust.linux@gmail.com> + 99 others); Mon, 12 Jun 2023 06:58:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59906 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237094AbjFLK5h (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 12 Jun 2023 06:57:37 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 40316E576; Mon, 12 Jun 2023 03:45:39 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id C90E9615CB; Mon, 12 Jun 2023 10:45:38 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 53A4BC433A8; Mon, 12 Jun 2023 10:45:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1686566738; bh=8dWgF0uA6APXTiliajrD56DAKjnBaeRdxdQyPjiYPP0=; h=From:To:Subject:Date:In-Reply-To:References:From; b=VNA1yc1YyUY8iRFte4FmbUVtUf3xLJi9hXnJ6eWRWnAhBF+pd7YKghWhRecMCbgZ7 yr57R+PZlxmUOpKdY6vogdgf5Gr4klr4agBTonta+PtTNZoD86j0g27zvORW3eK9OK ckKAln6kq/vdGBqDPxe0AphUUeibkpmZMvXEy35ssAkNPNlLtCWCucxt0cbrWCXW9/ a+Glo0O8+HA/jny1S2QTYqeGAXtduUlAp2ea5Gda6IIdGCnuOB1R0PcM6OVZvKiBvR LUcA7rvDLDnW/kSTwRPVhk1jLDA13CgKbUj/bA6NF07G9p+lglD/zt4af6w3SGbIYA guYVuHpahZfuw== From: Jeff Layton <jlayton@kernel.org> To: Christian Brauner <brauner@kernel.org>, Al Viro <viro@zeniv.linux.org.uk>, Brad Warrum <bwarrum@linux.ibm.com>, Ritu Agarwal <rituagar@linux.ibm.com>, Arnd Bergmann <arnd@arndb.de>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Ian Kent <raven@themaw.net>, "Tigran A. Aivazian" <aivazian.tigran@gmail.com>, Jeremy Kerr <jk@ozlabs.org>, Ard Biesheuvel <ardb@kernel.org>, Namjae Jeon <linkinjeon@kernel.org>, Sungjong Seo <sj1557.seo@samsung.com>, Steve French <sfrench@samba.org>, Paulo Alcantara <pc@manguebit.com>, Ronnie Sahlberg <lsahlber@redhat.com>, Shyam Prasad N <sprasad@microsoft.com>, Tom Talpey <tom@talpey.com>, John Johansen <john.johansen@canonical.com>, Paul Moore <paul@paul-moore.com>, James Morris <jmorris@namei.org>, "Serge E. Hallyn" <serge@hallyn.com>, Ruihan Li <lrh2000@pku.edu.cn>, Sebastian Reichel <sebastian.reichel@collabora.com>, Alan Stern <stern@rowland.harvard.edu>, Suren Baghdasaryan <surenb@google.com>, Wolfram Sang <wsa+renesas@sang-engineering.com>, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, autofs@vger.kernel.org, linux-efi@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-cifs@vger.kernel.org, samba-technical@lists.samba.org, apparmor@lists.ubuntu.com, linux-security-module@vger.kernel.org Subject: [PATCH v2 3/8] autofs: set ctime as well when mtime changes on a dir Date: Mon, 12 Jun 2023 06:45:19 -0400 Message-Id: <20230612104524.17058-4-jlayton@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230612104524.17058-1-jlayton@kernel.org> References: <20230612104524.17058-1-jlayton@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768495338375023307?= X-GMAIL-MSGID: =?utf-8?q?1768495338375023307?= |
Series |
fs: add some missing ctime updates
|
|
Commit Message
Jeff Layton
June 12, 2023, 10:45 a.m. UTC
When adding entries to a directory, POSIX generally requires that the
ctime also be updated alongside the mtime.
Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
fs/autofs/root.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
Comments
On 12/6/23 18:45, Jeff Layton wrote: > When adding entries to a directory, POSIX generally requires that the > ctime also be updated alongside the mtime. > > Signed-off-by: Jeff Layton <jlayton@kernel.org> Acked-by: Ian Kent <raven@themaw.net> > --- > fs/autofs/root.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/fs/autofs/root.c b/fs/autofs/root.c > index 6baf90b08e0e..93046c9dc461 100644 > --- a/fs/autofs/root.c > +++ b/fs/autofs/root.c > @@ -600,7 +600,7 @@ static int autofs_dir_symlink(struct mnt_idmap *idmap, > p_ino = autofs_dentry_ino(dentry->d_parent); > p_ino->count++; > > - dir->i_mtime = current_time(dir); > + dir->i_mtime = dir->i_ctime = current_time(dir); > > return 0; > } > @@ -633,7 +633,7 @@ static int autofs_dir_unlink(struct inode *dir, struct dentry *dentry) > d_inode(dentry)->i_size = 0; > clear_nlink(d_inode(dentry)); > > - dir->i_mtime = current_time(dir); > + dir->i_mtime = dir->i_ctime = current_time(dir); > > spin_lock(&sbi->lookup_lock); > __autofs_add_expiring(dentry); > @@ -749,7 +749,7 @@ static int autofs_dir_mkdir(struct mnt_idmap *idmap, > p_ino = autofs_dentry_ino(dentry->d_parent); > p_ino->count++; > inc_nlink(dir); > - dir->i_mtime = current_time(dir); > + dir->i_mtime = dir->i_ctime = current_time(dir); > > return 0; > }
On Mon, 12 Jun 2023 06:45:19 -0400, Jeff Layton wrote: > When adding entries to a directory, POSIX generally requires that the > ctime also be updated alongside the mtime. > > Can't find a tree for this patch, so picking this patch up unless told otherwise. --- Applied to the vfs.misc branch of the vfs/vfs.git tree. Patches in the vfs.misc branch should appear in linux-next soon. Please report any outstanding bugs that were missed during review in a new review to the original patch series allowing us to drop it. It's encouraged to provide Acked-bys and Reviewed-bys even though the patch has now been applied. If possible patch trailers will be updated. tree: https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git branch: vfs.misc [3/8] autofs: set ctime as well when mtime changes on a dir https://git.kernel.org/vfs/vfs/c/9b37b3342a98
On 14/6/23 16:30, Christian Brauner wrote: > On Mon, 12 Jun 2023 06:45:19 -0400, Jeff Layton wrote: >> When adding entries to a directory, POSIX generally requires that the >> ctime also be updated alongside the mtime. >> >> > Can't find a tree for this patch, so picking this patch up unless told otherwise. There's relatively few changes to autofs and Linus asked me to send changes via. Al or Andrew so there's no point in maintaining a tree anyway. Ian > > --- > > Applied to the vfs.misc branch of the vfs/vfs.git tree. > Patches in the vfs.misc branch should appear in linux-next soon. > > Please report any outstanding bugs that were missed during review in a > new review to the original patch series allowing us to drop it. > > It's encouraged to provide Acked-bys and Reviewed-bys even though the > patch has now been applied. If possible patch trailers will be updated. > > tree: https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git > branch: vfs.misc > > [3/8] autofs: set ctime as well when mtime changes on a dir > https://git.kernel.org/vfs/vfs/c/9b37b3342a98
diff --git a/fs/autofs/root.c b/fs/autofs/root.c index 6baf90b08e0e..93046c9dc461 100644 --- a/fs/autofs/root.c +++ b/fs/autofs/root.c @@ -600,7 +600,7 @@ static int autofs_dir_symlink(struct mnt_idmap *idmap, p_ino = autofs_dentry_ino(dentry->d_parent); p_ino->count++; - dir->i_mtime = current_time(dir); + dir->i_mtime = dir->i_ctime = current_time(dir); return 0; } @@ -633,7 +633,7 @@ static int autofs_dir_unlink(struct inode *dir, struct dentry *dentry) d_inode(dentry)->i_size = 0; clear_nlink(d_inode(dentry)); - dir->i_mtime = current_time(dir); + dir->i_mtime = dir->i_ctime = current_time(dir); spin_lock(&sbi->lookup_lock); __autofs_add_expiring(dentry); @@ -749,7 +749,7 @@ static int autofs_dir_mkdir(struct mnt_idmap *idmap, p_ino = autofs_dentry_ino(dentry->d_parent); p_ino->count++; inc_nlink(dir); - dir->i_mtime = current_time(dir); + dir->i_mtime = dir->i_ctime = current_time(dir); return 0; }