RTEMS | cpukit/libio: Support close with IOP references held (!516)

Gedare Bloom (@gedare) gitlab at rtems.org
Tue Jun 24 21:53:16 UTC 2025




Gedare Bloom started a new discussion on cpukit/libcsupport/src/libio.c: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/516#note_125224

 > +    /*
 > +     * Clear the flags. All references should have been dropped.
 > +     */
 > +    _Atomic_Store_uint( &iop->flags, LIBIO_FLAGS_FREE, ATOMIC_ORDER_RELAXED );
 >  
 > -  rtems_libio_lock();
 > +    rtems_filesystem_location_free( &iop->pathinfo );
 >  
 > -  /*
 > -   * Clear everything except the reference count part.  At this point in time
 > -   * there may be still some holders of this file descriptor.
 > -   */
 > -  rtems_libio_iop_flags_clear( iop, LIBIO_FLAGS_REFERENCE_INC - 1U );
 > -  zero = offsetof( rtems_libio_t, offset );
 > -  memset( (char *) iop + zero, 0, sizeof( *iop ) - zero );
 > +    rtems_libio_lock();

my intuitin is this should be locked earlier.

-- 
View it on GitLab: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/516#note_125224
You're receiving this email because of your account on gitlab.rtems.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/bugs/attachments/20250624/eda93130/attachment.htm>


More information about the bugs mailing list