summaryrefslogtreecommitdiff
path: root/c_src/posix_to_bcachefs.c
diff options
context:
space:
mode:
authorAriel Miculas <ariel.miculas@gmail.com>2024-06-04 10:43:25 +0300
committerKent Overstreet <kent.overstreet@linux.dev>2024-06-13 14:34:56 -0400
commit02f664a5d76385ebef943d141900a07d253879b6 (patch)
treede5673365b67f44b5c362fb65aab211d58f63715 /c_src/posix_to_bcachefs.c
parent5ac0826dd50b8b11e5595c0e5ad4b84ce57f269e (diff)
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>
Diffstat (limited to 'c_src/posix_to_bcachefs.c')
-rw-r--r--c_src/posix_to_bcachefs.c2
1 files changed, 1 insertions, 1 deletions
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);