Mikhail Karpov, le mer. 04 nov. 2026 09:40:46 +0700, a ecrit:
> On Tue, 3 Nov 2026 21:54:08 Samuel Thibault wrote:
>
> > > static struct port_bucket *pager_port_bucket = 0;
> > > static struct pager_requests *pager_requests;
> > > +static int dev_pading_success = 0;
> > >
> > > /* Initialize paging for this device. */
> > > -static void
> > > +static error_t
> > > init_dev_paging (void)
> > > {
> > > - if (! pager_port_bucket)
> > > + error_t err = 0;
> > > + if (!dev_pading_success)
> >
> > Why replacing testing pager_port_bucket with testing dev_pading_success?
> > The former should be working fine already.
>
> The issue is that pager_start_workers is called after ports_create_bucket,
> and
> it may return an error. If we check pager_port_bucket, then in the event of
> an error from pager_start_workers, we will not attempt to call that function
> again.
Ok, then you can use a local struct port_bucket* variable to store the
pointer while you are unsure whether the function will succeed, and then
either store to the global variable on success, or deallocate the bucket
on failure.
Samuel