In lustre_rsync if the file to be created in the target already exist
then handle this rather than returning an error.
Signed-off-by: John L. Hammond <john.hammond@intel.com>
Change-Id: I8c04c80cf8618b3681be12d098be0f07a305df30
Reviewed-on: http://review.whamcloud.com/20649
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Li Xi <lixi@ddn.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
} else {
rc = mknod(info->dest, S_IFREG | 0777, 0);
}
} else {
rc = mknod(info->dest, S_IFREG | 0777, 0);
}
- if (rc)
- return -errno;
+
+ if (rc < 0) {
+ if (errno == EEXIST)
+ rc = 0;
+ else
+ return -errno;
+ }
/* Sync data and attributes */
if (info->type == CL_CREATE || info->type == CL_MKDIR) {
/* Sync data and attributes */
if (info->type == CL_CREATE || info->type == CL_MKDIR) {