mirror of
https://github.com/containers/fuse-overlayfs.git
synced 2025-09-10 07:44:54 -04:00
Merge pull request #164 from giuseppe/fix-160
main: force a dir reload after a move
This commit is contained in:
commit
a0ba68151a
24
main.c
24
main.c
@ -1387,10 +1387,7 @@ load_dir (struct ovl_data *lo, struct ovl_node *n, struct ovl_layer *layer, char
|
|||||||
|
|
||||||
ret = it->ds->file_exists (it, parent_whiteout_path);
|
ret = it->ds->file_exists (it, parent_whiteout_path);
|
||||||
if (ret < 0 && errno != ENOENT && errno != ENOTDIR)
|
if (ret < 0 && errno != ENOENT && errno != ENOTDIR)
|
||||||
{
|
|
||||||
it->ds->closedir (dp);
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
|
||||||
|
|
||||||
if (ret == 0)
|
if (ret == 0)
|
||||||
break;
|
break;
|
||||||
@ -1530,6 +1527,7 @@ load_dir (struct ovl_data *lo, struct ovl_node *n, struct ovl_layer *layer, char
|
|||||||
n->last_layer = it;
|
n->last_layer = it;
|
||||||
stop_lookup = true;
|
stop_lookup = true;
|
||||||
}
|
}
|
||||||
|
it->ds->closedir (dp);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (get_timeout (lo) > 0)
|
if (get_timeout (lo) > 0)
|
||||||
@ -1980,28 +1978,20 @@ create_missing_whiteouts (struct ovl_data *lo, struct ovl_node *node, const char
|
|||||||
for (l = get_lower_layers (lo); l; l = l->next)
|
for (l = get_lower_layers (lo); l; l = l->next)
|
||||||
{
|
{
|
||||||
cleanup_dir DIR *dp = NULL;
|
cleanup_dir DIR *dp = NULL;
|
||||||
cleanup_close int cleanup_fd = -1;
|
|
||||||
|
|
||||||
cleanup_fd = l->ds->openat (l, from, O_DIRECTORY, 0755);
|
dp = l->ds->opendir (l, from);
|
||||||
if (cleanup_fd < 0)
|
if (dp == NULL)
|
||||||
{
|
{
|
||||||
if (errno == ENOENT)
|
|
||||||
continue;
|
|
||||||
if (errno == ENOTDIR)
|
if (errno == ENOTDIR)
|
||||||
break;
|
break;
|
||||||
|
if (errno == ENOENT)
|
||||||
|
continue;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
dp = fdopendir (cleanup_fd);
|
|
||||||
if (dp == NULL)
|
|
||||||
return -1;
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
struct dirent *dent;
|
struct dirent *dent;
|
||||||
|
|
||||||
cleanup_fd = -1; /* Now owned by dp. */
|
|
||||||
|
|
||||||
for (;;)
|
for (;;)
|
||||||
{
|
{
|
||||||
struct ovl_node key;
|
struct ovl_node key;
|
||||||
@ -2021,6 +2011,8 @@ create_missing_whiteouts (struct ovl_data *lo, struct ovl_node *node, const char
|
|||||||
continue;
|
continue;
|
||||||
if (strcmp (dent->d_name, "..") == 0)
|
if (strcmp (dent->d_name, "..") == 0)
|
||||||
continue;
|
continue;
|
||||||
|
if (has_prefix (dent->d_name, ".wh."))
|
||||||
|
continue;
|
||||||
|
|
||||||
node_set_name (&key, (char *) dent->d_name);
|
node_set_name (&key, (char *) dent->d_name);
|
||||||
|
|
||||||
@ -4176,6 +4168,8 @@ ovl_rename_direct (fuse_req_t req, fuse_ino_t parent, const char *name,
|
|||||||
if (update_paths (node) < 0)
|
if (update_paths (node) < 0)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
|
node->loaded = 0;
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user