[PATCH v2 1/2] liveupdate: luo_file: allow keeping private_data from retrieve until finish
Samiullah Khawaja
skhawaja at google.com
Tue Nov 10 10:29:54 PST 2026
On Tue, Nov 10, 2026 at 06:58:52PM +0100, Pratyush Yadav wrote:
>From: "Pratyush Yadav (Google)" <pratyush at kernel.org>
>
>The private_data field of struct liveupdate_file_op_args lets file
>handlers keep runtime state that is not preserved. It is set by
>.preserve() and passed to the later outgoing callbacks, up to
>.unpreserve(). But in the new kernel, nothing set by .retrieve() is
>kept, and .can_finish() and .finish() always get a NULL private_data.
>
>Handlers might need to keep runtime state from retrieve until finish.
>For example, memfd will need to remember the folios it holds on to
>until finish so it can release them there.
>
>Save the private_data set by a successful .retrieve() in the luo_file,
>and pass it to .can_finish() and .finish(). The handler must free it in
>.finish().
>
>While at it, update a stale comment under struct
>liveupdate_file_op_args. There is no 'data', but there is
>'serialized_data' and 'private_data'. Refer to them instead.
>
>Reviewed-by: Pasha Tatashin <pasha.tatashin at soleen.com>
>Signed-off-by: Pratyush Yadav (Google) <pratyush at kernel.org>
>---
> include/linux/liveupdate.h | 11 +++++++----
> kernel/liveupdate/luo_file.c | 11 ++++++++---
> 2 files changed, 15 insertions(+), 7 deletions(-)
>
Reviewed-by: Samiullah Khawaja <skhawaja at google.com>
More information about the kexec
mailing list