Reverted the part of r31520 that made devfs_unpublish_partition() take a raw
device path + child partition name. When a "raw" device is unpublished the node removal notification triggers the partition and child partitions to be unpublished/removed. Since in that case the "raw" node is already unpublished trying to resolve it in devfs_unpublish_partition() again to unpublish the child partitions would fail, leaving the child partition nodes behind. When a new raw device would then become available publishing its partitions would fail because of these left behind nodes, causing bug #4587. Seeing that this code is more compact and straight forward anyway I don't quite see why it was changed in the first place. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34967 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -232,8 +232,15 @@ KPartition::UnpublishDevice()
|
||||
if (!fPublishedName)
|
||||
return B_OK;
|
||||
|
||||
status_t error = devfs_unpublish_partition(Device()->Path(),
|
||||
fPublishedName);
|
||||
// get the path
|
||||
KPath path;
|
||||
status_t error = GetPath(&path);
|
||||
if (error != B_OK) {
|
||||
dprintf("KPartition::UnpublishDevice(): Failed to get path for "
|
||||
"partition %ld: %s\n", ID(), strerror(error));
|
||||
}
|
||||
|
||||
error = devfs_unpublish_partition(path.Path());
|
||||
if (error != B_OK) {
|
||||
dprintf("KPartition::UnpublishDevice(): Failed to unpublish partition "
|
||||
"%ld: %s\n", ID(), strerror(error));
|
||||
|
||||
Reference in New Issue
Block a user