Commit 8c40fa1
committed
zbd/rc: do not use invalid write pointer values by blkzone report
After the recent change in util-linux [1], the 'blkzone report' command
no longer reports numeric values for write pointers when the write
pointers are invalid. Instead, it reports the sting 'N/A'. Currently,
_get_blkzone_report() assumes that the write pointer values are numeric
even when the values are invalid. Then it evaluates 'N/A' as numeric and
triggers arithmetic operation failures.
To avoid the failures, check zone type and zone condition. If the zone
type and condition indicate that the write pointer is invalid, do not
use the blkzone report string. Instead, use -1 as the write pointer
value to indicate the value is invalid.
Link: [1] util-linux/util-linux@b032247
Reviewed-by: Damien Le Moal <[email protected]>
Signed-off-by: Shin'ichiro Kawasaki <[email protected]>1 parent f14914d commit 8c40fa1
1 file changed
Lines changed: 15 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
141 | 141 | | |
142 | 142 | | |
143 | 143 | | |
144 | | - | |
| 144 | + | |
145 | 145 | | |
146 | 146 | | |
147 | 147 | | |
148 | 148 | | |
149 | 149 | | |
150 | 150 | | |
151 | | - | |
152 | | - | |
153 | | - | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
154 | 165 | | |
155 | 166 | | |
156 | 167 | | |
| |||
0 commit comments