Re: [PATCH v3 1/2] liveupdate: prevent double management of files

From: Mike Rapoport

Date: Wed Mar 25 2026 - 14:56:33 EST


On Wed, Mar 25, 2026 at 06:20:25PM +0000, Pasha Tatashin wrote:
> Currently, LUO does not prevent the same file from being managed twice
> across different active sessions.
>
> Use a global xarray luo_preserved_files to keep track of file
> pointers being preserved by LUO. Update luo_preserve_file() to check and
> insert the file pointer into this xarray when it is preserved, and
> erase it in luo_file_unpreserve_files() when it is released.
>
> This ensures that the same file (struct file) cannot be managed by
> multiple sessions. If another session attempts to preserve an already
> managed file, it will now fail with -EBUSY.
>
> Acked-by: Pratyush Yadav (Google) <pratyush@xxxxxxxxxx>
> Reviewed-by: Samiullah Khawaja <skhawaja@xxxxxxxxxx>
> Signed-off-by: Pasha Tatashin <pasha.tatashin@xxxxxxxxxx>

Reviewed-by: Mike Rapoport (Microsoft) <rppt@xxxxxxxxxx>

> ---
> kernel/liveupdate/luo_file.c | 26 +++++++++++++++++++++++---
> 1 file changed, 23 insertions(+), 3 deletions(-)

--
Sincerely yours,
Mike.