From 2a55f34bd5514e905f6049f4e293352bd09ffe91 Mon Sep 17 00:00:00 2001 From: "John L. Hammond" Date: Mon, 6 Jun 2016 15:06:59 -0500 Subject: [PATCH] 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 --- lustre/utils/lustre_rsync.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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) { -- 1.8.3.1