Two "echo 0 > /sys/kernel/kexec_crash_size" OOPSes kernel. Also content of this file is invalid after first shrink to zero: it shows 1 instead of 0. This scenario is unlikely to happen often (root privs, valid crashkernel= in cmdline, dump-capture kernel not loaded), I hit it only by chance. This patch fixes it.
Unified · Split
| @@ -1134,11 +1134,9 @@ int crash_shrink_memory(unsigned long new_size) · 1133 unmodified lines | ||
| 1134 | 1134 | |
| 1135 | 1135 | free_reserved_phys_range(end, crashk_res.end); |
| 1136 | 1136 | |
| 1137 | − if (start == end) { | |
| 1138 | − crashk_res.end = end; | |
| 1137 | + if (start == end) | |
| 1139 | 1138 | release_resource(&crashk_res); |
| 1140 | − } else | |
| 1141 | − crashk_res.end = end - 1; | |
| 1139 | + crashk_res.end = end - 1; | |
| 1142 | 1140 | |
| 1143 | 1141 | unlock: |
| 1144 | 1142 | mutex_unlock(&kexec_mutex); |