packagefs: Fix handling of package-links directory on unmount
* Volume::_RemovePackageLinksDirectory(): We don't want to call _RemovePackageLinksNode(). Besides that the ID hash table has already been emptied before and we would thus release a reference to the node erroneously, the method doesn't do anything we want anyway. We don't want any children to be removed, since we have unregistered the volume's packages already (which removes the respective package link directories); the remaining ones are from other volumes and not ours to remove. * PackageFSRoot: Release a reference to the package links directory in the destructor. We create the directory in Init() after all and no one else takes over ownership.
This commit is contained in:
parent
c7382d4c9d
commit
05940bc514
@ -42,6 +42,9 @@ PackageFSRoot::PackageFSRoot(dev_t deviceID, ino_t nodeID)
|
||||
|
||||
PackageFSRoot::~PackageFSRoot()
|
||||
{
|
||||
if (fPackageLinksDirectory != NULL)
|
||||
fPackageLinksDirectory->ReleaseReference();
|
||||
|
||||
rw_lock_destroy(&fLock);
|
||||
}
|
||||
|
||||
|
@ -1863,7 +1863,7 @@ Volume::_RemovePackageLinksDirectory()
|
||||
|
||||
if (packageLinksDirectory->Parent() == fRootDirectory) {
|
||||
packageLinksDirectory->SetListener(NULL);
|
||||
_RemovePackageLinksNode(packageLinksDirectory);
|
||||
fRootDirectory->RemoveChild(packageLinksDirectory);
|
||||
packageLinksDirectory->SetParent(NULL);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user