mirror of
https://github.com/containers/fuse-overlayfs.git
synced 2025-09-15 18:30:10 -04:00
main: use the rename version when setting opaque
so that it can be correctly set on the directory before renaming it. Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
parent
632c56f4b9
commit
d4a957dea9
11
main.c
11
main.c
@ -833,6 +833,15 @@ hide_node (struct ovl_data *lo, struct ovl_node *node, bool unlink_src)
|
|||||||
bool needs_whiteout;
|
bool needs_whiteout;
|
||||||
|
|
||||||
needs_whiteout = (node->last_layer != get_upper_layer (lo)) && (node->parent && node->parent->last_layer != get_upper_layer (lo));
|
needs_whiteout = (node->last_layer != get_upper_layer (lo)) && (node->parent && node->parent->last_layer != get_upper_layer (lo));
|
||||||
|
if (!needs_whiteout && node_dirp (node))
|
||||||
|
{
|
||||||
|
ret = is_directory_opaque (get_upper_layer (lo), node->path);
|
||||||
|
if (ret < 0)
|
||||||
|
return ret;
|
||||||
|
if (ret)
|
||||||
|
needs_whiteout = true;
|
||||||
|
}
|
||||||
|
|
||||||
if (needs_whiteout)
|
if (needs_whiteout)
|
||||||
{
|
{
|
||||||
/* If the atomic rename+mknod failed, then fallback into doing it in two steps. */
|
/* If the atomic rename+mknod failed, then fallback into doing it in two steps. */
|
||||||
@ -2389,7 +2398,7 @@ create_directory (struct ovl_data *lo, int dirfd, const char *name, const struct
|
|||||||
char wd_tmp_file_name[32];
|
char wd_tmp_file_name[32];
|
||||||
bool need_rename;
|
bool need_rename;
|
||||||
|
|
||||||
need_rename = times || xattr_sfd >= 0 || uid != lo->uid || gid != lo->gid;
|
need_rename = set_opaque || times || xattr_sfd >= 0 || uid != lo->uid || gid != lo->gid;
|
||||||
if (!need_rename)
|
if (!need_rename)
|
||||||
{
|
{
|
||||||
/* mkdir can be used directly without a temporary directory in the working directory. */
|
/* mkdir can be used directly without a temporary directory in the working directory. */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user