partitioning: pass along reference to parent when uninitializing.

* Fixes problems with setting the partition name after uninitializing
  a partition in DriveSetup. Previously, UninitializeJob() was
  followed by SetStringJob(), but the kernel was updating the
  change counter for the parent partition when uninitializing a
  partition, leading to SetStringJob() having an incorrect change
  counter for the parent partition. Now the parent change counter
  will be correct when SetStringJob() runs.
This commit is contained in:
Jessica Hamilton
2016-12-23 18:53:15 +13:00
parent 9ba5f87313
commit 4419d699ec
9 changed files with 62 additions and 21 deletions
@@ -523,7 +523,15 @@ DiskDeviceJobGenerator::_GenerateUninitializeJob(BPartition* partition)
if (error != B_OK)
return error;
return _AddJob(new(nothrow) UninitializeJob(reference));
BPartition* parent = partition->Parent();
PartitionReference* parentReference = NULL;
if (parent != NULL) {
error = _GetPartitionReference(parent, parentReference);
if (error != B_OK)
return error;
}
return _AddJob(new(nothrow) UninitializeJob(reference, parentReference));
}