Re: [RFC] liveupdate: prevent double preservation

From: Pratyush Yadav

Date: Fri Mar 20 2026 - 06:31:58 EST


Hi Pasha,

On Mon, Mar 16 2026, Pasha Tatashin wrote:

> Currently, LUO does not prevent the same file from being preserved twice
> across different active sessions.
>
> Add a new i_state flag I_LUO_PRESERVED and update luo_preserve_file()
> to check and set this flag when a file is preserved, and clear it in
> luo_file_unpreserve_files() when it is released. This ensures that the
> same file (inode) cannot be preserved by multiple sessions. If another
> session attempts to preserve an already preserved file, it will now
> fail with -EBUSY.

For consistency, would it be a good idea to also set this flag after
retrieve? And then clear it on finish? If we do that then I suppose we
should rename the flag to I_LUO_MANAGED or something similar.

Other than this, LGTM from LUO perspective.

Acked-by: Pratyush Yadav (Google) <pratyush@xxxxxxxxxx>

[...]

--
Regards,
Pratyush Yadav