mirror of
https://github.com/containers/fuse-overlayfs.git
synced 2025-09-16 18:54:44 -04:00
fuse-overlayfs: fix lookup with multiple layers
when looking up multiple layers and we have already found a file, do not check if whiteouts are present in lower layers. The lookup in the lower layers is needed only to correctly propagate the inode number. Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1686889 Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
parent
ea72572364
commit
44d23bc07e
16
main.c
16
main.c
@ -1220,6 +1220,9 @@ do_lookup_file (struct ovl_data *lo, fuse_ino_t parent, const char *name)
|
||||
|
||||
if (errno == ENOENT)
|
||||
{
|
||||
if (node)
|
||||
continue;
|
||||
|
||||
ret = asprintf (&whpath, "%s/.wh.%s", pnode->path, name);
|
||||
if (ret < 0)
|
||||
return NULL;
|
||||
@ -1239,31 +1242,18 @@ do_lookup_file (struct ovl_data *lo, fuse_ino_t parent, const char *name)
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
if (node)
|
||||
node_free (node);
|
||||
|
||||
errno = saved_errno;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* If we already know the node, simply update the ino. */
|
||||
if (node)
|
||||
{
|
||||
if (node->whiteout && it == upper_layer)
|
||||
{
|
||||
hash_delete (pnode->children, node);
|
||||
node_free (node);
|
||||
node = NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
node->ino = st.st_ino;
|
||||
if (it->low)
|
||||
node->present_lowerdir = 1;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if (whpath == NULL)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user