Commit 79c9995
committed
Fix ZFS panic on space map corruption
Add defensive validation to prevent kernel panics when corrupted space map
data is encountered during pool import. Instead of panicking, the system
now logs corruption and continues in read-only mode.
Changes:
- space_map.c: Add bounds checking in space_map_load_callback to skip
zero-sized and out-of-bounds entries
- range_tree.c: Add defensive check in zfs_range_tree_remove_impl to detect
corrupted segment bounds and recover gracefully1 parent fc519b2 commit 79c9995
2 files changed
+27
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
503 | 503 | | |
504 | 504 | | |
505 | 505 | | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
506 | 518 | | |
507 | 519 | | |
508 | 520 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
402 | 402 | | |
403 | 403 | | |
404 | 404 | | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
405 | 420 | | |
406 | 421 | | |
407 | 422 | | |
| |||
0 commit comments