On 20.08.2026 4:39 AM, Christian Brauner wrote:
dump_emit() and dump_emit_page() open-code the same flush of the accumulated cprm->to_skip. Move it into a helper. No functional change. Signed-off-by: Christian Brauner (Amutable) <[email protected]>
Tested-by: R Nageswara Sastry <[email protected]> System: ppc64le LPAR (IBM POWER), Linux 7.3-rc2
--- fs/coredump.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/fs/coredump.c b/fs/coredump.c index 156688be3df0..cd36a72be445 100644 --- a/fs/coredump.c +++ b/fs/coredump.c @@ -1256,13 +1256,21 @@ static int __dump_skip(struct coredump_params *cprm, size_t nr) return __dump_emit(cprm, zeroes, nr); }-int dump_emit(struct coredump_params *cprm, const void *addr, int nr)+/* Flush the accumulated hole before writing data. */ +static int dump_flush_skip(struct coredump_params *cprm) { if (cprm->to_skip) { if (!__dump_skip(cprm, cprm->to_skip)) return 0; cprm->to_skip = 0; } + return 1; +} + +int dump_emit(struct coredump_params *cprm, const void *addr, int nr) +{ + if (!dump_flush_skip(cprm)) + return 0; return __dump_emit(cprm, addr, nr); } EXPORT_SYMBOL(dump_emit); @@ -1293,11 +1301,8 @@ static int dump_emit_page(struct coredump_params *cprm, struct page *page) if (!page) return 0;- if (cprm->to_skip) {- if (!__dump_skip(cprm, cprm->to_skip)) - return 0; - cprm->to_skip = 0; - } + if (!dump_flush_skip(cprm)) + return 0; if (cprm->written + PAGE_SIZE > cprm->limit) return 0; if (dump_interrupted())
-- Thanks and Regards R.Nageswara Sastry

