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

Address #256 #293

Closed
wants to merge 4 commits into from
Closed

Address #256 #293

wants to merge 4 commits into from

Conversation

taigrr
Copy link
Contributor

@taigrr taigrr commented Dec 3, 2021

If a disk has no partitions, common use cases for looping over partitions on the disk array created by Block.New() don't work as expected.
Now, underlying partition functions detect partitionless disks and treat a full-disk filesystem as a partition.

The Partition UUID is set to the empty string (since there isn't one), so this behavior can be detected.

This issue will resolve #256

@taigrr
Copy link
Contributor Author

taigrr commented Dec 6, 2021

@fromanirh Could you take a look at this please?

Copy link
Collaborator

@ffromani ffromani left a comment

Choose a reason for hiding this comment

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

The code per se looks fine and it is very much like how I'd solve this bug. I think we should have some (at least one) test to exercise the new code path though, also to prevent future regressions.

pkg/block/block_linux.go Show resolved Hide resolved
pkg/block/block_linux.go Show resolved Hide resolved
Signed-off-by: Tai Groot <tai@taigrr.com>
Signed-off-by: Tai Groot <tai@taigrr.com>
@taigrr
Copy link
Contributor Author

taigrr commented Mar 19, 2022

I am closing this PR since github doesn't let you change the name of the source branch for comparison and I now have multiple PRs. I'll reopen and reference this PR in the new one.

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.

can not show mountpoint for nvme disk
2 participants