Mikhail Karpov, le dim. 06 sept. 2026 10:03:23 +0700, a ecrit:
> Hello,
> 
> On Sun, 6 Sep 2026 01:24:50 Samuel Thibault wrote:
> 
> > > diff --git a/libdiskfs/io-map-cntl.c b/libdiskfs/io-map-cntl.c
> > > index 6432fa0..981681f 100644
> > > --- a/libdiskfs/io-map-cntl.c
> > > +++ b/libdiskfs/io-map-cntl.c
> > > @@ -32,11 +32,25 @@ diskfs_S_io_map_cntl (struct protid *cred,
> > >    pthread_mutex_lock (&cred->po->np->lock);
> > >    if (!cred->mapped)
> > >      {
> > > -      default_pager_object_create (diskfs_default_pager,
> > > &cred->shared_object,
> > > -                                __vm_page_size);
> > > -      vm_map (mach_task_self (), (vm_address_t *)&cred->mapped,
> vm_page_size,
> > > -           0, 1, cred->shared_object, 0, 0,
> > > -           VM_PROT_READ|VM_PROT_WRITE, VM_PROT_READ|VM_PROT_WRITE, 0);
> > > +      error_t err = default_pager_object_create (diskfs_default_pager,
> > > + &cred->shared_object,
> > > + __vm_page_size);
> > > +      if (err)
> > > +     {
> > > +       pthread_mutex_unlock (&cred->po->np->lock);
> > > +       return err;
> > > +     }
> > > +
> > > +      err = vm_map (mach_task_self (), (vm_address_t *)&cred->mapped,
> > > +                 vm_page_size, 0, 1, cred->shared_object, 0, 0,
> > > +                 VM_PROT_READ|VM_PROT_WRITE,
> > > +                 VM_PROT_READ|VM_PROT_WRITE, 0);
> > > +      if (err)
> > > +     {
> >
> > We'd want to release and clear cred->shared_object.
> 
> Am I correct in understanding that mach_port_deallocate needs to be called
> for this?

Yes, but as I mentioned, it also needs to be cleared. I have fixed your
change before pushing.

Thanks!
Samuel

Reply via email to