Re: [PATCH v2 3/8] liveupdate: Remove file handler module refcounting

From: David Matlack

Date: Tue Mar 24 2026 - 17:25:30 EST


On Wed, Mar 18, 2026 at 7:17 AM Pasha Tatashin
<pasha.tatashin@xxxxxxxxxx> wrote:
>
> File handlers do not need to pin modules indefinitely or during active
> live update sessions. The VFS 'struct file' pins the file handler's module
> via f_op->owner during active sessions, making dynamic reference counting
> unnecessary for handlers.
>
> When a file is preserved, the live update core obtains a 'struct file'
> via fdget(). As long as the file is kept open within the live update
> session, the module is pinned by the VFS and cannot be unloaded.

After invoking the file handler's retrieve(), LUO should probably
check that the created file's owner matches the file handler's owner,
since this scheme relies on that being true.

If there is a mismatch, LUO can put the file that was just created,
log a warning, and return an error up to the user.