Skip to content

Commit

Permalink
libmfu: fix: with dsync no longer ensured that target directory exist…
Browse files Browse the repository at this point in the history
…s as before with dcmp
  • Loading branch information
adammoody committed Aug 30, 2018
1 parent 9a7fa37 commit 381a2d1
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/common/mfu_flist_copy.c
Original file line number Diff line number Diff line change
Expand Up @@ -508,8 +508,8 @@ static int mfu_create_directory(mfu_flist list, uint64_t idx,
}

/* Skipping the destination directory ONLY if it already exists.
* If we are doing a dsync operation it is safe to assume that
* the destination directory already exists. The reason that
* If we are doing a sync operation and if the dest dir does not
* exist, we need to create it. The reason that
* the dest_path and the destpath->path are compared is because
* if we are syncing two directories we want the tree to have the
* same number of levels. If dsync is on then only the contents of
Expand All @@ -519,8 +519,10 @@ static int mfu_create_directory(mfu_flist list, uint64_t idx,
* not dsync is on happens prior to this in
* mfu_param_path_copy_dest. */

if ((mfu_copy_opts->do_sync) &&
(strncmp(dest_path, destpath->path, strlen(dest_path)) == 0)) {
if (mfu_copy_opts->do_sync &&
(strncmp(dest_path, destpath->path, strlen(dest_path)) == 0) &&
destpath->target_stat_valid)
{
mfu_free(&dest_path);
return 0;
}
Expand Down

0 comments on commit 381a2d1

Please sign in to comment.