UserlandFS: Fix detection when a file system should be deleted.
This was a regression from hrev39870 where a private Referenceable class was replaced with BReferenceable. Referenceable::RemoveReference() returned a boolean to indicate whether the last reference was released while BReferenceable::ReleaseReference() returns the previous reference count. A file system would therefore be deleted when any but the last reference to it would be released (when multiple volumes of that file system were mounted and one of them was unmounted) and leaked otherwise (when only one volume of that file system was mounted and then unmounted). Fixes #11718.
This commit is contained in:
@@ -164,7 +164,7 @@ UserlandFS::_UnregisterFileSystem(const char* name)
|
||||
if (!fileSystemInitializer)
|
||||
return B_BAD_VALUE;
|
||||
|
||||
deleteFS = fileSystemInitializer->ReleaseReference();
|
||||
deleteFS = fileSystemInitializer->ReleaseReference() == 1;
|
||||
if (deleteFS)
|
||||
fFileSystems->Remove(name);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user