Re: [PATCH 3/6] liveupdate: Defer file handler module refcounting to active sessions

From: Pasha Tatashin

Date: Tue Mar 17 2026 - 14:33:21 EST


On Tue, Mar 17, 2026 at 12:39 PM David Matlack <dmatlack@xxxxxxxxxx> wrote:
>
> 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.

Hi David,

Thanks for review. This is a very good point. I will remove taking
file handler reference entirely.

>
> For FLB it makes more sense since the FLB's owner is likely not the
> same as the file's owner.

+1.

Pasha