Skip to content

Commit

Permalink
udiskslinuxprovider: Add TODO about not sending a 'remove' uevent to …
Browse files Browse the repository at this point in the history
…block objects

Not sending a 'remove' uevent to block objects might be an issue for attached
interfaces from modules, not having a chance to do proper cleanup. For the moment
we rely on modules not taking a reference to the block object and do proper
cleanup in object destructor.
  • Loading branch information
tbzatek committed May 22, 2020
1 parent d6b7cab commit 3f9083a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/udiskslinuxprovider.c
Expand Up @@ -1166,6 +1166,13 @@ handle_block_uevent_for_block (UDisksLinuxProvider *provider,
object = g_hash_table_lookup (provider->sysfs_to_block, sysfs_path);
if (object != NULL)
{
/* TODO: consider sending the 'remove' uevent to block objects and propagate
* it to module interfaces so that proper cleanup could be done. Modules
* are still liable to perform cleanup within their object destructors.
* It is equally important for modules to avoid taking reference to
* #UDisksLinuxBlockObject as it creates recursive references and
* the block object may never get freed.
*/
block_pre_remove (provider, object);
g_dbus_object_manager_server_unexport (udisks_daemon_get_object_manager (daemon),
g_dbus_object_get_object_path (G_DBUS_OBJECT (object)));
Expand Down

0 comments on commit 3f9083a

Please sign in to comment.