Re: [PATCH v2 1/2] liveupdate: luo_file: allow keeping private_data from retrieve until finish

From: Samiullah Khawaja

Date: Tue Nov 10 2026 - 13:53:00 EST


On Tue, Nov 10, 2026 at 06:58:52PM +0100, Pratyush Yadav wrote:
From: "Pratyush Yadav (Google)" <pratyush@xxxxxxxxxx>

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@xxxxxxxxxx>
Signed-off-by: Pratyush Yadav (Google) <pratyush@xxxxxxxxxx>
---
include/linux/liveupdate.h | 11 +++++++----
kernel/liveupdate/luo_file.c | 11 ++++++++---
2 files changed, 15 insertions(+), 7 deletions(-)


Reviewed-by: Samiullah Khawaja <skhawaja@xxxxxxxxxx>