Re: [PATCH 3/6] liveupdate: Defer file handler module refcounting to active sessions
From: David Matlack
Date: Tue Mar 17 2026 - 12:44:14 EST
On Mon, Mar 16, 2026 at 7:50 PM Pasha Tatashin
<pasha.tatashin@xxxxxxxxxx> wrote:
> @@ -281,7 +282,10 @@ int luo_preserve_file(struct luo_file_set *file_set, u64 token, int fd)
> scoped_guard(rwsem_read, &luo_file_handler_lock) {
> list_private_for_each_entry(fh, &luo_file_handler_list, list) {
> if (fh->ops->can_preserve(fh, file)) {
> - err = 0;
> + if (try_module_get(fh->ops->owner))
> + err = 0;
> + else
> + err = -ENODEV;
> break;
> }
> }
Does LUO even need to take a reference to the file handler owner?
LUO already takes a reference to the file, and the file should already
be holding a reference to the file's owner, which should (must?) be
the same as the file handler's owner.
For FLB it makes more sense since the FLB's owner is likely not the
same as the file's owner.