Re: [PATCH v6 03/12] PCI: liveupdate: Track incoming preserved PCI devices

From: David Matlack

Date: Wed Jun 17 2026 - 18:07:52 EST


On Mon, Jun 15, 2026 at 1:29 PM David Matlack <dmatlack@xxxxxxxxxx> wrote:
> On 2026-06-14 01:38 PM, Pasha Tatashin wrote:
> > On Fri, 22 May 2026 20:24:01 +0000, David Matlack <dmatlack@xxxxxxxxxx> wrote:

> > > +static struct pci_flb_incoming *pci_liveupdate_flb_get_incoming(void)
> > > +{
> > > + struct pci_flb_incoming *incoming = NULL;
> > > + int ret;
> >
> > Maybe make the error return static, and avoid another search through compatible
> > FLBs if it failed before?
>
> Good idea, will do.

Actually I'm not so sure this should be handled her. I would have to
create a statically allocated variable to cache the result, like you
said, and I would also have to invalidate it during FLB finish to
avoid use-after-free. That defeats one of the main benefits of FLB
which is that we don't have to manage global variables.

Can this be handled by LUO instead?