fix(probe): fetch block size and drive type for partitions#537
fix(probe): fetch block size and drive type for partitions#537akhilerm merged 1 commit intoopenebs-archive:masterfrom
Conversation
f1dba7e to
507409e
Compare
| klog.Errorf("unable to get sysfs device for device: %s, err: %v", blockDevice.DevPath, err) | ||
| return | ||
| } | ||
| pSysFsDevice := sysFsDevice |
There was a problem hiding this comment.
Why is this assignment done? If the Parent device is present it can be assigned to sysFsDevice after https://github.com/openebs/node-disk-manager/pull/537/files#diff-8ab703382db619675921914253cefd11e57af1e4dd2a260aa24bfa029da7ad0fR107
There was a problem hiding this comment.
Because sysFsDevice is still being used to calculate the capacity here - https://github.com/openebs/node-disk-manager/blob/507409ecc94216ddc467a38e84c1899e4228da0c/cmd/ndm_daemonset/probe/sysfsprobe.go#L158
So a reference to the original blockdevice is still needed
There was a problem hiding this comment.
another way would be to move the call which requires a reference to the original blockdevice above all the other calls, and reassign sysFsDevice after that
There was a problem hiding this comment.
another way would be to move the call which requires a reference to the original blockdevice above all the other calls, and reassign sysFsDevice after that
@z0marlin , I thnk this method ^^^ will be better. Anything that requires parent device comes after reassining. Also can you rename psysfsDevice to parentSysFSDevice and the same with pDev to parentDev
f071c20 to
f58a5c9
Compare
sysfsprobe fetches logical/physical blocksize, hw sector size, and drive type from sysfs using `<syspath>/queue` directory. This directory is available only for parent disks and not partitions. These details for partitions are same as their parent disks. Use their parent disks to fetch the details. Fixes openebs/openebs#3134 Signed-off-by: Aditya Jain <aditya.jainadityajain.jain@gmail.com>
f58a5c9 to
e805d3a
Compare
sysfsprobe fetches logical/physical blocksize, hw sector size,
and drive type from sysfs using
<syspath>/queuedirectory.This directory is available only for parent disks and not partitions.
These details for partitions are same as their parent disks. Use
their parent disks to fetch the details.
Testing
Manually tested by running in a minikube cluster

Checklist:
<type>(<scope>): <subject>