fuse-overlayfs: check if it is a whiteout also when doing a lookup

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
Giuseppe Scrivano 2018-07-11 16:20:51 +02:00
parent dbf5732c75
commit 0d02ef15ce
No known key found for this signature in database
GPG Key ID: E4730F97F60286ED

8
main.c
View File

@ -852,6 +852,8 @@ do_lookup_file (struct ovl_data *lo, fuse_ino_t parent, const char *name)
for (it = lo->layers; it; it = it->next)
{
const char *wh_name;
sprintf (path, "%s/%s", pnode->path, name);
ret = TEMP_FAILURE_RETRY (fstatat (it->fd, path, &st, AT_SYMLINK_NOFOLLOW));
if (ret < 0)
@ -868,7 +870,11 @@ do_lookup_file (struct ovl_data *lo, fuse_ino_t parent, const char *name)
return NULL;
}
node = make_ovl_node (path, it, name, 0, st.st_mode & S_IFDIR);
wh_name = get_whiteout_name (name, &st);
if (wh_name)
node = make_whiteout_node (wh_name);
else
node = make_ovl_node (path, it, name, 0, st.st_mode & S_IFDIR);
if (node == NULL)
{
errno = ENOMEM;