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 for MOUNTPOINT missing in output of lsblk command #28

Merged
merged 4 commits into from
Aug 28, 2023

Conversation

AkshaySainiDell
Copy link
Contributor

@AkshaySainiDell AkshaySainiDell commented Aug 25, 2023

Description

In util-linux 2.37.4-11.el9_2, the lsblk command did not include MOUNTPOINT field in its output. This field is required in getMountInfoFromDevice method; without this the code breaks with below error

panic: runtime error: index out of range [1] with length 1

goroutine 60 [running]:
github.com/dell/gofsutil.(*FS).getMountInfoFromDevice(0x0?, {0x1fde490, 0xc000681800}, {0xc0005380a8, 0x11})
	/root/Projects/Proj1/pkg/mod/github.com/dell/[email protected]/gofsutil_mount_linux.go:467 +0xe3f

In this PR, we have modified the lsblk command to consistently include the necessary fields, including 'MOUNTPOINT', in its output. This resolves the issue and ensures the code operates as expected.

Reference: util-linux/util-linux#1474

GitHub Issues

List the GitHub issues impacted by this PR:

GitHub Issue #
dell/csm#966

Checklist:

  • I have performed a self-review of my own code to ensure there are no formatting, vetting, linting, or security issues
  • I have verified that new and existing unit tests pass locally with my changes
  • I have not allowed coverage numbers to degenerate
  • I have maintained at least 90% code coverage
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • Backward compatibility is not broken

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Please also list any relevant details for your test configuration

  • Build driver image with UBI9 base image and ran cert-csi -
  • iSCSI image
  • NVMe image
  • NFS image
    image

Copy link
Contributor

@adarsh-dell adarsh-dell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work! @AkshaySainiDell

Copy link
Contributor

@boyamurthy boyamurthy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@boyamurthy boyamurthy merged commit f7f26c1 into main Aug 28, 2023
3 of 4 checks passed
@anandrajak1 anandrajak1 deleted the hotfix-lsblk-mountpoints branch October 17, 2024 19:25
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.

5 participants