From ab83e348fb77f91b3a9c09ab87c9c357bdafb1d7 Mon Sep 17 00:00:00 2001 From: Ariel Miculas Date: Fri, 14 Jun 2024 21:46:53 +0300 Subject: [PATCH] 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(-) diff --git a/c_src/posix_to_bcachefs.c b/c_src/posix_to_bcachefs.c index c66b9734..714eb47d 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);