From 02f664a5d76385ebef943d141900a07d253879b6 Mon Sep 17 00:00:00 2001 From: Ariel Miculas Date: Tue, 4 Jun 2024 10:43:25 +0300 Subject: 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 Signed-off-by: Kent Overstreet --- c_src/posix_to_bcachefs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'c_src') diff --git a/c_src/posix_to_bcachefs.c b/c_src/posix_to_bcachefs.c index 52105be1..d4899605 100644 --- a/c_src/posix_to_bcachefs.c +++ b/c_src/posix_to_bcachefs.c @@ -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); -- cgit v1.2.3