Skip to content

Conversation

@schaefi
Copy link
Collaborator

@schaefi schaefi commented Jun 25, 2025

The function get_partition_node_name takes the disk device and the partition index as arguments to match against the respective device node for this partition index. The partition index is the position of the partition in the partition table according to their start offset. For the code to function properly it is required that the list of partitions provided by lsblk is ordered according to the start address of the partitions in the table. The way lsblk was called did not enforce this ordering. This commit enforces the order to be done against the start offset and fixes bsc#1245190

The function get_partition_node_name takes the disk device
and the partition index as arguments to match against the
respective device node for this partition index. The partition
index is the position of the partition in the partition table
according to their start offset. For the code to function
properly it is required that the list of partitions provided
by lsblk is ordered according to the start address of the
partitions in the table. The way lsblk was called did not
enforce this ordering. This commit enforces the order to
be done against the start offset and fixes bsc#1245190
@schaefi schaefi requested a review from Conan-Kudo June 25, 2025 07:41
@schaefi schaefi self-assigned this Jun 25, 2025
@schaefi
Copy link
Collaborator Author

schaefi commented Jun 25, 2025

Confirmation from my team member @jgleissner is needed prior merge. Thus the don't merge label is still set

@Conan-Kudo Conan-Kudo marked this pull request as draft June 25, 2025 07:50
@schaefi
Copy link
Collaborator Author

schaefi commented Jun 25, 2025

All right, got confirmation from my colleague

apoz@amunoz-test-20250625-1:~> df -BG /dev/nvme0n1p3 | sed 1D
/dev/nvme0n1p3       10G    3G        8G  27% /
apoz@amunoz-test-20250625-1:~>    lsblk -p -l -o NAME,TYPE /dev/nvme0n1 | grep -E "part|md$" | cut -f1 -d ' '
/dev/nvme0n1p2
/dev/nvme0n1p3
/dev/nvme0n1p1
apoz@amunoz-test-20250625-1:~>  lsblk -p -l -o NAME,TYPE,START -x START /dev/nvme0n1 | grep -E "part|md$" | cut -f1 -d ' '
/dev/nvme0n1p1
/dev/nvme0n1p2
/dev/nvme0n1p3

so the fix works

@schaefi schaefi marked this pull request as ready for review June 25, 2025 10:11
@Conan-Kudo Conan-Kudo merged commit a98ccc0 into main Jun 25, 2025
14 checks passed
@Conan-Kudo Conan-Kudo deleted the fix_get_partition_node_name branch June 25, 2025 10:24
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