Re: [PATCH v6 06/20] liveupdate: luo_file: implement file systems callbacks
From: Pratyush Yadav <pratyush@kernel.org>
Date: 2025-11-18 18:17:57
Also in:
linux-doc, linux-fsdevel, linux-mm, lkml
On Tue, Nov 18 2025, Pasha Tatashin wrote:
On Tue, Nov 18, 2025 at 12:43 PM Pratyush Yadav [off-list ref] wrote:quoted
On Tue, Nov 18 2025, David Matlack wrote:quoted
On 2025-11-15 06:33 PM, Pasha Tatashin wrote:quoted
This patch implements the core mechanism for managing preserved files throughout the live update lifecycle. It provides the logic to invoke the file handler callbacks (preserve, unpreserve, freeze, unfreeze, retrieve, and finish) at the appropriate stages. During the reboot phase, luo_file_freeze() serializes the final metadata for each file (handler compatible string, token, and data handle) into a memory region preserved by KHO. In the new kernel, luo_file_deserialize() reconstructs the in-memory file list from this data, preparing the session for retrieval. Signed-off-by: Pasha Tatashin <pasha.tatashin@soleen.com>quoted
+int liveupdate_register_file_handler(struct liveupdate_file_handler *h);Should there be a way to unregister a file handler? If VFIO is built as module then I think it would need to be able to unregister its file handler when the module is unloaded to avoid leaking pointers to its text in LUO.I actually had full unregister functionality in v4 and earlier, but I dropped it from this series to minimize the footprint and get the core infrastructure landed first. For now, safety is guaranteed because liveupdate_register_file_handler() and liveupdate_register_flb() take a module reference. This effectively pins any module that registers with LUO, meaning those driver modules cannot be unloaded or upgraded dynamically, they can only be updated via Live Update or full reboot.
What if liveupdate_register_flb() fails? It would need to unregister its file handler too, since the file handler can't really work without its FLB. Shouldn't happen in practice, but still LUO clients need a way to handle this failure. [...] -- Regards, Pratyush Yadav