From: John L. Hammond Date: Mon, 6 Jun 2016 20:06:59 +0000 (-0500) Subject: LU-4781 utils: handle EEXIST in lustre_rsync X-Git-Tag: 2.8.55~19 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=2a55f34bd5514e905f6049f4e293352bd09ffe91 LU-4781 utils: handle EEXIST in lustre_rsync 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 Change-Id: I8c04c80cf8618b3681be12d098be0f07a305df30 Reviewed-on: http://review.whamcloud.com/20649 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Li Xi Reviewed-by: Andreas Dilger --- diff --git a/lustre/utils/lustre_rsync.c b/lustre/utils/lustre_rsync.c index c3eab0f..08de581 100644 --- a/lustre/utils/lustre_rsync.c +++ b/lustre/utils/lustre_rsync.c @@ -612,8 +612,13 @@ int lr_mkfile(struct lr_info *info) } 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) {