NAS-129750 / 24.04.2 / fix scrambing start sector of data partitions in pool.expand (by yocalebo) #13952
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
A fix was done here recently to ensure we maintain the start sector offset of the data partition for
pool.expand
. However, it uncovered the fact that we're not calculating the start sector properly because the kernel has 0 documentation on these sysfs files (which is where we enumerate this information) and so we made an incorrect assumption of how it works. This manifests itself on 4kn drives. Almost all userspace tools for manipulating partitions will default to expecting the information is provided in sectors. Without these changes, we're not doing that properly. Reproduced in-house trivially and was able to test these changes afterwards.NOTE: I will be pushing another proper PR with tests after this is merged. However, I need to add 4kn emulated drives to our VM environment for the tests to be valid. This needs to be merged in time for 24.04.2 so this is why I'm opening it up without tests right now.
NOTE 2: I've found that we have a bunch of code duplication related to enumerating partition info. I will push, yet another, PR to master that consolidates this code and makes this situation much harder to hit in the future.
Original PR: #13945
Jira URL: https://ixsystems.atlassian.net/browse/NAS-129750