From 6d75146e29712ea90d2ea9cc88e97d461831a56e Mon Sep 17 00:00:00 2001 From: Giuseppe Scrivano Date: Tue, 26 May 2020 22:19:52 +0200 Subject: [PATCH] main: correctly report copyup error the copyup function returns the error code set in ret. Make sure ret has the correct return code if set_fd_origin fails. Closes: https://github.com/containers/fuse-overlayfs/issues/211 Signed-off-by: Giuseppe Scrivano --- main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/main.c b/main.c index b0cfdd6..15eb416 100644 --- a/main.c +++ b/main.c @@ -2704,7 +2704,8 @@ copyup (struct ovl_data *lo, struct ovl_node *node) if (ret < 0) goto exit; - if (set_fd_origin (dfd, node->path) < 0) + ret = set_fd_origin (dfd, node->path); + if (ret < 0) goto exit; /* Finally, move the file to its destination. */