From c99226b70b74d464121b5101442e0da799e9a3dd Mon Sep 17 00:00:00 2001 From: Giuseppe Scrivano Date: Tue, 23 Jul 2019 11:04:54 +0200 Subject: [PATCH] main: skip RENAME_WHITEOUT if we cannot use mknod Signed-off-by: Giuseppe Scrivano --- main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.c b/main.c index c1bea1b..e8c2f54 100644 --- a/main.c +++ b/main.c @@ -766,8 +766,8 @@ hide_node (struct ovl_data *lo, struct ovl_node *node, bool unlink_src) if (unlink_src) { /* If the atomic rename+mknod failed, then fallback into doing it in two steps. */ - if (syscall (SYS_renameat2, node_dirfd (node), node->path, lo->workdir_fd, - newpath, RENAME_WHITEOUT) < 0) + if (!can_mknod || syscall (SYS_renameat2, node_dirfd (node), node->path, lo->workdir_fd, + newpath, RENAME_WHITEOUT) < 0) { if (node->parent) {