Commit 7ee7fd8
btrfs: make read verification handle bs > ps cases without large folios
The current read verification is also relying on large folios to support
bs > ps cases, but that introduced quite some limits.
To enhance read-repair to support bs > ps without large folios:
- Make btrfs_data_csum_ok() to accept an array of paddrs
Which can pass the paddrs[] direct into
btrfs_calculate_block_csum_pages().
- Make repair_one_sector() to accept an array of paddrs
So that it can submit a repair bio backed by regular pages, not only
large folios.
This requires us to allocate more slots at bio allocation time though.
Also since the caller may have only partially advanced the saved_iter
for bs > ps cases, we can not directly trust the logical bytenr from
saved_iter (can be unaligned), thus a manual round down is necessary
for the logical bytenr.
- Make btrfs_check_read_bio() to build an array of paddrs
The tricky part is that we can only call btrfs_data_csum_ok() after
all involved pages are assembled.
This means at the call time of btrfs_check_read_bio(), our offset
inside the bio is already at the end of the fs block.
Thus we must re-calculate @bio_offset for btrfs_data_csum_ok() and
repair_one_sector().
Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>1 parent 9e15f50 commit 7ee7fd8
3 files changed
+52
-30
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
171 | 171 | | |
172 | 172 | | |
173 | 173 | | |
174 | | - | |
175 | 174 | | |
176 | 175 | | |
177 | 176 | | |
| |||
188 | 187 | | |
189 | 188 | | |
190 | 189 | | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
191 | 196 | | |
192 | | - | |
| 197 | + | |
193 | 198 | | |
194 | 199 | | |
195 | 200 | | |
| |||
204 | 209 | | |
205 | 210 | | |
206 | 211 | | |
207 | | - | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | | - | |
213 | 212 | | |
214 | 213 | | |
215 | 214 | | |
| |||
231 | 230 | | |
232 | 231 | | |
233 | 232 | | |
234 | | - | |
| 233 | + | |
235 | 234 | | |
236 | 235 | | |
237 | 236 | | |
238 | 237 | | |
239 | | - | |
240 | 238 | | |
241 | | - | |
242 | | - | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
243 | 247 | | |
244 | 248 | | |
245 | 249 | | |
246 | 250 | | |
247 | 251 | | |
248 | | - | |
249 | 252 | | |
250 | 253 | | |
251 | 254 | | |
| |||
265 | 268 | | |
266 | 269 | | |
267 | 270 | | |
268 | | - | |
| 271 | + | |
269 | 272 | | |
270 | | - | |
271 | | - | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
272 | 283 | | |
273 | 284 | | |
274 | 285 | | |
| |||
284 | 295 | | |
285 | 296 | | |
286 | 297 | | |
287 | | - | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
288 | 301 | | |
289 | 302 | | |
290 | 303 | | |
| 304 | + | |
291 | 305 | | |
292 | 306 | | |
293 | 307 | | |
| |||
306 | 320 | | |
307 | 321 | | |
308 | 322 | | |
309 | | - | |
310 | | - | |
311 | | - | |
312 | | - | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
313 | 333 | | |
314 | 334 | | |
315 | 335 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
550 | 550 | | |
551 | 551 | | |
552 | 552 | | |
553 | | - | |
| 553 | + | |
554 | 554 | | |
555 | 555 | | |
556 | 556 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3420 | 3420 | | |
3421 | 3421 | | |
3422 | 3422 | | |
3423 | | - | |
| 3423 | + | |
| 3424 | + | |
3424 | 3425 | | |
3425 | 3426 | | |
3426 | 3427 | | |
3427 | 3428 | | |
3428 | | - | |
| 3429 | + | |
3429 | 3430 | | |
3430 | 3431 | | |
3431 | 3432 | | |
3432 | 3433 | | |
3433 | 3434 | | |
3434 | 3435 | | |
3435 | 3436 | | |
3436 | | - | |
| 3437 | + | |
3437 | 3438 | | |
3438 | 3439 | | |
3439 | 3440 | | |
3440 | 3441 | | |
3441 | | - | |
| 3442 | + | |
| 3443 | + | |
3442 | 3444 | | |
3443 | 3445 | | |
3444 | 3446 | | |
| |||
3458 | 3460 | | |
3459 | 3461 | | |
3460 | 3462 | | |
3461 | | - | |
| 3463 | + | |
| 3464 | + | |
3462 | 3465 | | |
3463 | 3466 | | |
3464 | 3467 | | |
| |||
3467 | 3470 | | |
3468 | 3471 | | |
3469 | 3472 | | |
3470 | | - | |
3471 | | - | |
3472 | | - | |
| 3473 | + | |
| 3474 | + | |
3473 | 3475 | | |
3474 | 3476 | | |
3475 | 3477 | | |
| |||
0 commit comments