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:
Ingo Weinhold 2013-04-05 00:31:51 +02:00
parent c7382d4c9d
commit 05940bc514
2 changed files with 4 additions and 1 deletions

View File

@ -42,6 +42,9 @@ PackageFSRoot::PackageFSRoot(dev_t deviceID, ino_t nodeID)
PackageFSRoot::~PackageFSRoot()
{
if (fPackageLinksDirectory != NULL)
fPackageLinksDirectory->ReleaseReference();
rw_lock_destroy(&fLock);
}

View File

@ -1863,7 +1863,7 @@ Volume::_RemovePackageLinksDirectory()
if (packageLinksDirectory->Parent() == fRootDirectory) {
packageLinksDirectory->SetListener(NULL);
_RemovePackageLinksNode(packageLinksDirectory);
fRootDirectory->RemoveChild(packageLinksDirectory);
packageLinksDirectory->SetParent(NULL);
}
}