Re: [PATCH v3 03/10] liveupdate: Protect file handler list with rwsem
From: Pasha Tatashin
Date: Mon Mar 30 2026 - 15:33:47 EST
> >Because liveupdate file handlers will no longer hold a module reference
> >when registered, we must ensure that the access to the handler list is
> >protected against concurrent module unloading.
>
> Nit: Here we make an assumption that the file (and flb) handler
> lifecycle is bound with the module lifecycle. It is a fair assumption,
> but maybe this can be documented somewhere?
That is true, we can certainly add this to Doc. comment. This could be
done as a follow-up change if needed.
> >+ up_read(&luo_register_rwlock);
>
> We took the read lock here when running can_preserve, but then we use
> the fh without taking the lock later before calling file_preserve. This
> is safe since the module reference is taken and fh will not go away
> (based on the assumption I mentioned above). Maybe add a comment here
> that documents this assumption.
Sure, if I respin this series, I will add a comment; otherwise, it
will be a follow-up change along with updating the documentation
comment as you suggested above.
Thanks,
Pasha