Thread (1 message) 1 message, 1 author, 2025-09-23

Re: [PATCH v3 17/30] liveupdate: luo_files: luo_ioctl: Unregister all FDs on device close

From: Pratyush Yadav <pratyush@kernel.org>
Date: 2025-09-23 13:13:49
Also in: linux-doc, linux-fsdevel, linux-mm, lkml

On Mon, Sep 22 2025, Pasha Tatashin wrote:
On Wed, Aug 27, 2025 at 11:34 AM Pratyush Yadav [off-list ref] wrote:
quoted
Hi Pasha,

On Thu, Aug 07 2025, Pasha Tatashin wrote:
quoted
Currently, a file descriptor registered for preservation via the remains
globally registered with LUO until it is explicitly unregistered. This
creates a potential for resource leaks into the next kernel if the
userspace agent crashes or exits without proper cleanup before a live
update is fully initiated.

This patch ties the lifetime of FD preservation requests to the lifetime
of the open file descriptor for /dev/liveupdate, creating an implicit
"session".

When the /dev/liveupdate file descriptor is closed (either explicitly
via close() or implicitly on process exit/crash), the .release
handler, luo_release(), is now called. This handler invokes the new
function luo_unregister_all_files(), which iterates through all FDs
that were preserved through that session and unregisters them.
Why special case files here? Shouldn't you undo all the serialization
done for all the subsystems?
Good point, subsystems should also be cancelled, and system should be
brought back to normal state. However, with session support, we will
be dropping only FDs that belong to a specific session when its FD is
closed, or all FDs+subsystems when closing /dev/liveupdate.
Yeah, that makes sense.

[...]

-- 
Regards,
Pratyush Yadav
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help