You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
function WiperCollectDiskMajors is used to collect the major mumber of a disk in guest to populate knownDiskMajor, which is then used in the WiperIsDiskDevice function. WiperIsDiskDevice is called by WiperPartitionFilter, the relevant code is as follows:
staticvoidWiperPartitionFilter(WiperPartition*item, // IN/OUTMNTINFO*mnt, // INBoolshrinkableOnly) // IN
{
...
if (i==ARRAYSIZE(gKnownPartitions)) {
comment="Unknown filesystem. Contact VMware.";
} elseif (item->type!=PARTITION_UNSUPPORTED&&shrinkableOnly) {
/* * If the partition is supported by the wiper library, do some other * checks before declaring it shrinkable. */if (info->diskBacked) {
if (Posix_Stat(MNTINFO_NAME(mnt), &s) <0) {
comment="Unknown device.";
#if defined(sun) || defined(__linux__)
} elseif (!S_ISBLK(s.st_mode)) {
comment="Not a block device.";
#endif
} elseif (!WiperIsDiskDevice(mnt, &s)) {
comment="Not a disk device.";
} elseif (MNTINFO_MNT_IS_RO(mnt)) {
comment="Not writable.";
}
} elseif (Posix_Access(MNTINFO_MNTPT(mnt), W_OK) !=0) {
comment="Mount point not writable.";
}
if (comment!=NULL) {
item->type=PARTITION_UNSUPPORTED;
}
}
...
}
WiperIsDiskDevice will only be called if shrinkableOnly is true, so there's a enhancement that can be made.
In function WiperPartition_Open, add following:
if(shrinkableOnly) {
WiperCollectDiskMajors();
}
In function WiperSinglePartition_Open, add following:
if(shrinkableOnly) {
WiperCollectDiskMajors();
}
Is that reasonable?
Reproduction steps
NULL
Expected behavior
NULL
Additional context
No response
The text was updated successfully, but these errors were encountered:
It seems reasonable, diskInfo::GuestInfoGetDiskInfoWiper() calls WiperPartition_Open() with FALSE. I don't see knownDiskMajor being used on that codepath (shrinkableOnly=FALSE).
There is a caveat that if WiperPartitionFilter changes how it handles shrinkableOnly, or WiperIsDiskDevice is ever used outside of a shinkableOnly == TRUE codepath will have a potential inconsistency.
Describe the bug
It's not strictly a bug.
In file
open-vm-tools/lib/wiper/wiperPosix.c
there is the following function:function
WiperCollectDiskMajors
is used to collect the major mumber of a disk in guest to populateknownDiskMajor
, which is then used in theWiperIsDiskDevice
function.WiperIsDiskDevice
is called byWiperPartitionFilter
, the relevant code is as follows:WiperIsDiskDevice
will only be called ifshrinkableOnly
is true, so there's a enhancement that can be made.In function
WiperPartition_Open
, add following:In function
WiperSinglePartition_Open
, add following:Is that reasonable?
Reproduction steps
NULL
Expected behavior
NULL
Additional context
No response
The text was updated successfully, but these errors were encountered: