* vfs.c (vfs_rmstamp): Rescan the tree after the parents have

been removed.  Otherwise using old data causes data corruption
in some combinations (e.g. extfs inside tatfs).
This commit is contained in:
Pavel Roskin 2003-10-30 05:58:06 +00:00
parent 6f9f431ae6
commit 24dd87b714
2 changed files with 25 additions and 16 deletions

View File

@ -1,3 +1,9 @@
2003-10-30 Pavel Roskin <proski@gnu.org>
* vfs.c (vfs_rmstamp): Rescan the tree after the parents have
been removed. Otherwise using old data causes data corruption
in some combinations (e.g. extfs inside tatfs).
2003-10-29 Pavel Roskin <proski@gnu.org> 2003-10-29 Pavel Roskin <proski@gnu.org>
* extfs.c: Remove current_dir field, its role was purely * extfs.c: Remove current_dir field, its role was purely

View File

@ -346,23 +346,26 @@ void
vfs_rmstamp (struct vfs_class *v, vfsid id, int removeparents) vfs_rmstamp (struct vfs_class *v, vfsid id, int removeparents)
{ {
struct vfs_stamping *stamp, *st1; struct vfs_stamping *stamp, *st1;
for (stamp = stamps, st1 = NULL; stamp != NULL; st1 = stamp, stamp = stamp->next)
if (stamp->v == v && stamp->id == id){
if (stamp->parent != NULL){
if (removeparents)
vfs_rmstamp (stamp->parent->v, stamp->parent->id, 1);
vfs_rm_parents (stamp->parent);
}
if (st1 == NULL){
stamps = stamp->next;
} else {
st1->next = stamp->next;
}
g_free (stamp);
return; for (stamp = stamps, st1 = NULL; stamp != NULL;
} st1 = stamp, stamp = stamp->next)
if (stamp->v == v && stamp->id == id) {
if (stamp->parent != NULL) {
if (removeparents)
vfs_rmstamp (stamp->parent->v, stamp->parent->id, 1);
vfs_rm_parents (stamp->parent);
stamp->parent = NULL;
continue; /* rescan the tree */
}
if (st1 == NULL) {
stamps = stamp->next;
} else {
st1->next = stamp->next;
}
g_free (stamp);
return;
}
} }
static int static int