Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(csi-driver): support getting device size from devpath #765

Merged
merged 4 commits into from
Mar 1, 2024

Conversation

niladrih
Copy link
Member

@niladrih niladrih commented Mar 1, 2024

Changes:

  • the Device::lookup() API doesn't return a dev-name, but instead returns a dev-path. Changed the size function to accept either.
  • the failure! macro prints errors event if they are never encountered, when used with the ok_or() combinator. Using the ok_or_else() combinator instead.
  • Adjusting the expected capacity of the nexus during NodeExpandVolume call to be at most 10MiB less than the requested capacity.

@niladrih niladrih marked this pull request as ready for review March 1, 2024 08:23
Signed-off-by: Niladri Halder <niladri.halder26@gmail.com>
Signed-off-by: Niladri Halder <niladri.halder26@gmail.com>
When processing the NodeExpandVolume CSI call, we compare the sysfs size
of the volume nexus against the requested capacity. Shaving 10MiB off the
requested capacity puts the number in the ballpark range of the capacity
we expect from the nexus after the ControllerExpandVolume has expanded it.

Signed-off-by: Niladri Halder <niladri.halder26@gmail.com>
control-plane/csi-driver/src/bin/controller/controller.rs Outdated Show resolved Hide resolved
control-plane/csi-driver/src/bin/controller/controller.rs Outdated Show resolved Hide resolved
control-plane/csi-driver/src/bin/node/node.rs Outdated Show resolved Hide resolved
control-plane/csi-driver/src/bin/node/node.rs Show resolved Hide resolved
control-plane/csi-driver/src/bin/node/node.rs Outdated Show resolved Hide resolved
@niladrih
Copy link
Member Author

niladrih commented Mar 1, 2024

bors merge

bors-openebs-mayastor bot pushed a commit that referenced this pull request Mar 1, 2024
765: fix(csi-driver): support getting device size from devpath r=niladrih a=niladrih

Changes:
- the Device::lookup() API doesn't return a dev-name, but instead returns a dev-path. Changed the size function to accept either.
- the `failure!` macro prints errors event if they are never encountered, when used with the `ok_or()` combinator. Using the `ok_or_else()` combinator instead.
- Adjusting the expected capacity of the nexus during NodeExpandVolume call to be at most 10MiB less than the requested capacity.

Co-authored-by: Niladri Halder <niladri.halder26@gmail.com>
@bors-openebs-mayastor
Copy link

Canceled.

Signed-off-by: Niladri Halder <niladri.halder26@gmail.com>
@niladrih
Copy link
Member Author

niladrih commented Mar 1, 2024

bors merge

@bors-openebs-mayastor
Copy link

🕐 Waiting for PR status (Github check) to be set, probably by CI. Bors will automatically try to run when all required PR statuses are set.

@bors-openebs-mayastor
Copy link

Build succeeded:

@bors-openebs-mayastor bors-openebs-mayastor bot merged commit 7a1b569 into develop Mar 1, 2024
4 checks passed
@bors-openebs-mayastor bors-openebs-mayastor bot deleted the dev_name_as_if branch March 1, 2024 16:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants