main: skip RENAME_WHITEOUT if we cannot use mknod

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
Giuseppe Scrivano 2019-07-23 11:04:54 +02:00
parent a4ebbc8361
commit c99226b70b
No known key found for this signature in database
GPG Key ID: E4730F97F60286ED

4
main.c
View File

@ -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)
{