Re: [PATCH v7 06/22] liveupdate: luo_file: implement file systems callbacks
From: Pasha Tatashin
Date: Tue Nov 25 2025 - 10:18:35 EST
> > + if (err)
> > + goto err_files_mem;
>
> Nit: ^^ two spaces here.
Removed.
>
> > +
> > + if (file_set->count == LUO_FILE_MAX) {
> > + err = -ENOSPC;
> > + goto err_files_mem;
> > + }
> > +
> > + err = -ENOENT;
> > + luo_list_for_each_private(fh, &luo_file_handler_list, list) {
> > + if (fh->ops->can_preserve(fh, file)) {
> > + err = 0;
> > + break;
> > + }
> > + }
> > +
> [...]
> > +int liveupdate_register_file_handler(struct liveupdate_file_handler *fh)
> > +{
> > + struct liveupdate_file_handler *fh_iter;
> > + int err;
> > +
> > + if (!liveupdate_enabled())
> > + return -EOPNOTSUPP;
> > +
> > + /* Sanity check that all required callbacks are set */
> > + if (!fh->ops->preserve || !fh->ops->unpreserve ||
> > + !fh->ops->retrieve || !fh->ops->finish) {
>
> You are still missing a check for can_preserve() here. It is a mandatory
> callback and luo_preserve_file() calls it without checking for NULL.
Added.
>
> With these and Mike's comments addressed,
>
> Reviewed-by: Pratyush Yadav <pratyush@xxxxxxxxxx>
Thanks.
>
> > + return -EINVAL;
> > + }
> > +
> [...]
>
> --
> Regards,
> Pratyush Yadav