Commit 62ea078
committed
blockdev: Backfill partition number from sysfs for older lsblk
The PARTN column was added in util-linux 2.39, but CentOS 9 / RHEL 9
ship util-linux 2.37. When lsblk -O is used on these systems, the
partn field is absent from JSON output, causing find_device_by_partno()
to fail with "Missing partition for index N".
Add backfill_partn() alongside the existing backfill_start() to read
the partition number from /sys/dev/block/{maj:min}/partition when lsblk
doesn't provide it.
Assisted-by: Claude Code (Opus 4)
Signed-off-by: ckyrouac <ckyrouac@redhat.com>1 parent dc0ed00 commit 62ea078
1 file changed
Lines changed: 22 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
123 | 144 | | |
124 | 145 | | |
125 | 146 | | |
126 | 147 | | |
| 148 | + | |
127 | 149 | | |
128 | 150 | | |
129 | 151 | | |
| |||
0 commit comments