linux-yocto/fs/nilfs2
Ryusuke Konishi e30ccbb9c0 nilfs2: do not update mtime of renamed directory that is not moved
A minor issue with nilfs_rename, originating from an old ext2
implementation, is that the mtime is updated even if the rename target is
a directory and it is renamed within the same directory, rather than moved
to a different directory.

In this case, the child directory being renamed does not change in any
way, so changing its mtime is unnecessary according to the specification,
and can unnecessarily confuse backup tools.

In ext2, this issue was fixed by commit 39fe7557b4 ("ext2: Do not update
mtime of a moved directory") and a few subsequent fixes, but it remained
in nilfs2.

Fix this issue by not calling nilfs_set_link(), which rewrites the inode
number of the directory entry that refers to the parent directory, when
the move target is a directory and the source and destination are the same
directory.

Here, the directory to be moved only needs to be read if the inode number
of the parent directory is rewritten with nilfs_set_link, so also adjust
the execution conditions of the preparation work to avoid unnecessary
directory reads.

Link: https://lkml.kernel.org/r/20250111143518.7901-3-konishi.ryusuke@gmail.com
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2025-01-24 22:47:26 -08:00
..
alloc.c nilfs2: add missing return value kernel-doc descriptions 2025-01-24 22:47:25 -08:00
alloc.h nilfs2: add missing return value kernel-doc descriptions 2025-01-24 22:47:25 -08:00
bmap.c nilfs2: correct return value kernel-doc descriptions for bmap functions 2025-01-24 22:47:25 -08:00
bmap.h nilfs2: use the BITS_PER_LONG macro 2024-09-01 20:43:42 -07:00
btnode.c nilfs2: revise the return value description style for consistency. 2025-01-24 22:47:25 -08:00
btnode.h
btree.c nilfs2: correct return value kernel-doc descriptions for bmap functions 2025-01-24 22:47:25 -08:00
btree.h nilfs2: add missing description of nilfs_btree_path structure 2024-09-01 20:43:36 -07:00
cpfile.c nilfs2: revise the return value description style for consistency. 2025-01-24 22:47:25 -08:00
cpfile.h nilfs2: remove nilfs_cpfile_{get,put}_checkpoint() 2024-02-22 15:38:53 -08:00
dat.c nilfs2: revise the return value description style for consistency. 2025-01-24 22:47:25 -08:00
dat.h
dir.c nilfs2: handle errors that nilfs_prepare_chunk() may return 2025-01-24 22:47:25 -08:00
direct.c nilfs2: fix failure to detect DAT corruption in btree and direct mappings 2024-03-14 09:17:29 -07:00
direct.h
export.h
file.c nilfs2: fix hang in nilfs_lookup_dirty_data_buffers() 2024-02-07 21:20:36 -08:00
gcinode.c nilfs2: correct return value kernel-doc descriptions for the rest 2025-01-24 22:47:25 -08:00
ifile.c nilfs2: revise the return value description style for consistency. 2025-01-24 22:47:25 -08:00
ifile.h nilfs2: convert inode file to be folio-based 2024-11-05 17:12:38 -08:00
inode.c nilfs2: add missing return value kernel-doc descriptions 2025-01-24 22:47:25 -08:00
ioctl.c nilfs2: revise the return value description style for consistency. 2025-01-24 22:47:25 -08:00
Kconfig fs: add CONFIG_BUFFER_HEAD 2023-08-02 09:13:09 -06:00
Makefile
mdt.c nilfs2: add missing return value kernel-doc descriptions 2025-01-24 22:47:25 -08:00
mdt.h
namei.c nilfs2: do not update mtime of renamed directory that is not moved 2025-01-24 22:47:26 -08:00
nilfs.h nilfs2: handle errors that nilfs_prepare_chunk() may return 2025-01-24 22:47:25 -08:00
page.c nilfs2: add missing return value kernel-doc descriptions 2025-01-24 22:47:25 -08:00
page.h nilfs2: convert nilfs_page_count_clean_buffers() to take a folio 2024-11-05 17:12:39 -08:00
recovery.c nilfs2: add missing return value kernel-doc descriptions 2025-01-24 22:47:25 -08:00
segbuf.c nilfs2: correct return value kernel-doc descriptions for the rest 2025-01-24 22:47:25 -08:00
segbuf.h
segment.c nilfs2: revise the return value description style for consistency. 2025-01-24 22:47:25 -08:00
segment.h nilfs2: use kthread_create and kthread_stop for the log writer thread 2024-09-01 20:43:44 -07:00
sufile.c nilfs2: revise the return value description style for consistency. 2025-01-24 22:47:25 -08:00
sufile.h nilfs2: add missing return value kernel-doc descriptions 2025-01-24 22:47:25 -08:00
super.c nilfs2: add missing return value kernel-doc descriptions 2025-01-24 22:47:25 -08:00
sysfs.c nilfs2: protect references to superblock parameters exposed in sysfs 2024-09-01 17:59:00 -07:00
sysfs.h
the_nilfs.c nilfs2: add missing return value kernel-doc descriptions 2025-01-24 22:47:25 -08:00
the_nilfs.h nilfs2: eliminate the shared counter and spinlock for i_generation 2024-09-01 20:43:43 -07:00