Preserve directory {a,m,c} times by calling copy_times() after the recursion

Otherwise the directory {a,m,c} times will be modified by the recursive
copy of the directory tree.

Signed-off-by: Ariel Miculas <ariel.miculas@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
Ariel Miculas 2024-06-14 21:46:53 +03:00 committed by Kent Overstreet
parent 3a4a096cd2
commit ab83e348fb

View File

@ -360,7 +360,6 @@ static void copy_dir(struct copy_fs_state *s,
if (dst_inum)
*dst_inum = inode.bi_inum;
copy_times(c, &inode, &stat);
copy_xattrs(c, &inode, d->d_name);
/* copy xattrs */
@ -395,6 +394,7 @@ static void copy_dir(struct copy_fs_state *s,
BUG();
}
copy_times(c, &inode, &stat);
update_inode(c, &inode);
next:
free(child_path);