Skip to content

Commit

Permalink
Preserve directory {a,m,c} times by calling copy_times() after the re…
Browse files Browse the repository at this point in the history
…cursion

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

Signed-off-by: Ariel Miculas <[email protected]>
Signed-off-by: Kent Overstreet <[email protected]>
  • Loading branch information
ariel-miculas authored and Kent Overstreet committed Jun 16, 2024
1 parent 3a4a096 commit ab83e34
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion c_src/posix_to_bcachefs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit ab83e34

Please sign in to comment.