diff --git a/0001-udiskslinuxmountoptions-Do-not-free-static-daemon-resources.patch b/0001-udiskslinuxmountoptions-Do-not-free-static-daemon-resources.patch deleted file mode 100644 index 18a4ed0f6b310c25d9da59f7e16130a969cfd6d7..0000000000000000000000000000000000000000 --- a/0001-udiskslinuxmountoptions-Do-not-free-static-daemon-resources.patch +++ /dev/null @@ -1,74 +0,0 @@ -From d205057296957d6064825252a3d3377e809d6fed Mon Sep 17 00:00:00 2001 -From: Tomas Bzatek -Date: Wed, 6 Oct 2021 17:12:13 +0200 -Subject: [PATCH] udiskslinuxmountoptions: Do not free static daemon resources - -The GResource instance returned from udisks_daemon_resources_get_resource() -that calls g_static_resource_get_resource() internally is marked as -'(transfer none)' and should not be freed. In fact that causes double -free inside the g_static_resource_fini() atexit handler leading -to memory corruption causing random failures of further atexit -handlers such as cryptsetup and openssl destructors. - - Invalid read of size 4 - at 0x4BB03A4: g_resource_unref (gresource.c:527) - by 0x4BB2150: g_static_resource_fini (gresource.c:1449) - by 0x4010ADB: _dl_fini (dl-fini.c:139) - by 0x4EF0DF4: __run_exit_handlers (exit.c:113) - by 0x4EF0F6F: exit (exit.c:143) - by 0x4ED9566: __libc_start_call_main (libc_start_call_main.h:74) - by 0x4ED960B: __libc_start_main@@GLIBC_2.34 (libc-start.c:409) - by 0x128774: (below main) (in udisks/src/.libs/udisksd) - Address 0x5cc5fc0 is 0 bytes inside a block of size 16 free'd - at 0x48430E4: free (vg_replace_malloc.c:755) - by 0x4DB10BC: g_free (gmem.c:199) - by 0x4BB2148: g_static_resource_fini (gresource.c:1448) - by 0x4010ADB: _dl_fini (dl-fini.c:139) - by 0x4EF0DF4: __run_exit_handlers (exit.c:113) - by 0x4EF0F6F: exit (exit.c:143) - by 0x4ED9566: __libc_start_call_main (libc_start_call_main.h:74) - by 0x4ED960B: __libc_start_main@@GLIBC_2.34 (libc-start.c:409) - by 0x128774: (below main) (in udisks/src/.libs/udisksd) - Block was alloc'd at - at 0x484086F: malloc (vg_replace_malloc.c:380) - by 0x4DB47A8: g_malloc (gmem.c:106) - by 0x4BB19C7: UnknownInlinedFun (gresource.c:545) - by 0x4BB19C7: g_resource_new_from_data (gresource.c:613) - by 0x4BB1A88: register_lazy_static_resources_unlocked (gresource.c:1374) - by 0x4BB218C: UnknownInlinedFun (gresource.c:1393) - by 0x4BB218C: UnknownInlinedFun (gresource.c:1387) - by 0x4BB218C: g_static_resource_get_resource (gresource.c:1472) - by 0x14F6A3: UnknownInlinedFun (udisks-daemon-resources.c:284) - by 0x14F6A3: udisks_linux_mount_options_get_builtin (udiskslinuxmountoptions.c:612) - by 0x12CC6E: udisks_daemon_constructed (udisksdaemon.c:441) - by 0x4D1ED96: g_object_new_internal (gobject.c:1985) - by 0x4D20227: g_object_new_valist (gobject.c:2288) - by 0x4D2075C: g_object_new (gobject.c:1788) - by 0x129A5F: udisks_daemon_new (udisksdaemon.c:619) - by 0x129AD5: on_bus_acquired (main.c:63) - by 0x4C35C95: connection_get_cb.lto_priv.0 (gdbusnameowning.c:504) - by 0x4BD3F99: g_task_return_now (gtask.c:1219) - by 0x4BD419A: UnknownInlinedFun (gtask.c:1289) - by 0x4BD419A: g_task_return (gtask.c:1245) - by 0x4C31D51: bus_get_async_initable_cb (gdbusconnection.c:7433) - by 0x4BD3F99: g_task_return_now (gtask.c:1219) - by 0x4BD3FDC: complete_in_idle_cb (gtask.c:1233) - by 0x4DA852A: g_idle_dispatch (gmain.c:5897) - by 0x4DAC33E: UnknownInlinedFun (gmain.c:3381) - by 0x4DAC33E: g_main_context_dispatch (gmain.c:4099) ---- - src/udiskslinuxmountoptions.c | 1 - - 1 file changed, 1 deletion(-) - -diff --git a/src/udiskslinuxmountoptions.c b/src/udiskslinuxmountoptions.c -index 7729d40159..819c9ba96a 100644 ---- a/src/udiskslinuxmountoptions.c -+++ b/src/udiskslinuxmountoptions.c -@@ -614,7 +614,6 @@ udisks_linux_mount_options_get_builtin (void) - "/org/freedesktop/UDisks2/data/builtin_mount_options.conf", - G_RESOURCE_LOOKUP_FLAGS_NONE, - &error); -- g_resource_unref (daemon_resource); - - if (builtin_opts_bytes == NULL) - { diff --git a/0002-udiskslinuxpartitiontable-Fix-GError-ownership.patch b/0002-udiskslinuxpartitiontable-Fix-GError-ownership.patch deleted file mode 100644 index 69ac7e85d76ce524e4c88080f40fedcad0c3fc96..0000000000000000000000000000000000000000 --- a/0002-udiskslinuxpartitiontable-Fix-GError-ownership.patch +++ /dev/null @@ -1,76 +0,0 @@ -From 8b5a3a131ef546db418b844af109f2a15f16d92e Mon Sep 17 00:00:00 2001 -From: Tomas Bzatek -Date: Sat, 1 Jan 2022 19:59:27 +0100 -Subject: [PATCH 1/4] udiskslinuxpartitiontable: Fix GError ownership - ---- - src/udiskslinuxpartitiontable.c | 11 ++++------- - 1 file changed, 4 insertions(+), 7 deletions(-) - -diff --git a/src/udiskslinuxpartitiontable.c b/src/udiskslinuxpartitiontable.c -index e43a0708..4ae30a0d 100644 ---- a/src/udiskslinuxpartitiontable.c -+++ b/src/udiskslinuxpartitiontable.c -@@ -277,7 +277,7 @@ udisks_linux_partition_table_handle_create_partition (UDisksPartitionTable *ta - object = udisks_daemon_util_dup_object (table, &error); - if (object == NULL) - { -- g_dbus_method_invocation_take_error (invocation, error); -+ g_dbus_method_invocation_return_gerror (invocation, error); - goto out; - } - -@@ -293,7 +293,6 @@ udisks_linux_partition_table_handle_create_partition (UDisksPartitionTable *ta - goto out; - } - -- error = NULL; - if (!udisks_daemon_util_get_caller_uid_sync (daemon, - invocation, - NULL /* GCancellable */, -@@ -301,7 +300,6 @@ udisks_linux_partition_table_handle_create_partition (UDisksPartitionTable *ta - &error)) - { - g_dbus_method_invocation_return_gerror (invocation, error); -- g_clear_error (&error); - goto out; - } - -@@ -464,7 +462,7 @@ udisks_linux_partition_table_handle_create_partition (UDisksPartitionTable *ta - if (!bd_part_set_part_name (device_name, part_spec->path, name, &error)) - { - g_prefix_error (&error, "Error setting name for newly created partition: "); -- g_dbus_method_invocation_take_error (invocation, error); -+ g_dbus_method_invocation_return_gerror (invocation, error); - udisks_simple_job_complete (UDISKS_SIMPLE_JOB (job), FALSE, error->message); - goto out; - } -@@ -483,7 +481,7 @@ udisks_linux_partition_table_handle_create_partition (UDisksPartitionTable *ta - if (!ret) - { - g_prefix_error (&error, "Error setting type for newly created partition: "); -- g_dbus_method_invocation_take_error (invocation, error); -+ g_dbus_method_invocation_return_gerror (invocation, error); - udisks_simple_job_complete (UDISKS_SIMPLE_JOB (job), FALSE, error->message); - goto out; - } -@@ -516,7 +514,6 @@ udisks_linux_partition_table_handle_create_partition (UDisksPartitionTable *ta - /* sit and wait for the partition to show up */ - g_warn_if_fail (wait_data->pos_to_wait_for > 0); - wait_data->partition_table_object = object; -- error = NULL; - partition_object = udisks_daemon_wait_for_object_sync (daemon, - wait_for_partition, - wait_data, -@@ -526,7 +523,7 @@ udisks_linux_partition_table_handle_create_partition (UDisksPartitionTable *ta - if (partition_object == NULL) - { - g_prefix_error (&error, "Error waiting for partition to appear: "); -- g_dbus_method_invocation_take_error (invocation, error); -+ g_dbus_method_invocation_return_gerror (invocation, error); - udisks_simple_job_complete (UDISKS_SIMPLE_JOB (job), FALSE, error->message); - goto out; - } --- -2.31.1 - diff --git a/0003-udiskslinuxpartition-Fix-GError-ownership.patch b/0003-udiskslinuxpartition-Fix-GError-ownership.patch deleted file mode 100644 index ffd98134a65df2757580e033f12d85e08b37b5f3..0000000000000000000000000000000000000000 --- a/0003-udiskslinuxpartition-Fix-GError-ownership.patch +++ /dev/null @@ -1,73 +0,0 @@ -From b2fc3d0001dcf5e438e730fadafa3eed8518f5ce Mon Sep 17 00:00:00 2001 -From: Tomas Bzatek -Date: Sat, 1 Jan 2022 20:11:57 +0100 -Subject: [PATCH 2/4] udiskslinuxpartition: Fix GError ownership - ---- - src/udiskslinuxpartition.c | 15 ++++++--------- - 1 file changed, 6 insertions(+), 9 deletions(-) - -diff --git a/src/udiskslinuxpartition.c b/src/udiskslinuxpartition.c -index 5461b390..3d970768 100644 ---- a/src/udiskslinuxpartition.c -+++ b/src/udiskslinuxpartition.c -@@ -135,8 +135,7 @@ check_authorization (UDisksPartition *partition, - caller_uid, - &error)) - { -- g_dbus_method_invocation_return_gerror (invocation, error); -- g_clear_error (&error); -+ g_dbus_method_invocation_take_error (invocation, error); - goto out; - } - -@@ -351,7 +350,7 @@ handle_set_flags (UDisksPartition *partition, - object = udisks_daemon_util_dup_object (partition, &error); - if (object == NULL) - { -- g_dbus_method_invocation_take_error (invocation, error); -+ g_dbus_method_invocation_return_gerror (invocation, error); - goto out; - } - -@@ -499,7 +498,7 @@ handle_set_name (UDisksPartition *partition, - object = udisks_daemon_util_dup_object (partition, &error); - if (object == NULL) - { -- g_dbus_method_invocation_take_error (invocation, error); -+ g_dbus_method_invocation_return_gerror (invocation, error); - goto out; - } - -@@ -873,7 +872,7 @@ handle_resize (UDisksPartition *partition, - object = udisks_daemon_util_dup_object (partition, &error); - if (object == NULL) - { -- g_dbus_method_invocation_take_error (invocation, error); -+ g_dbus_method_invocation_return_gerror (invocation, error); - goto out; - } - -@@ -994,7 +993,7 @@ handle_delete (UDisksPartition *partition, - object = udisks_daemon_util_dup_object (partition, &error); - if (object == NULL) - { -- g_dbus_method_invocation_take_error (invocation, error); -+ g_dbus_method_invocation_return_gerror (invocation, error); - goto out; - } - -@@ -1012,9 +1011,7 @@ handle_delete (UDisksPartition *partition, - if (!udisks_linux_block_teardown (block, invocation, options, &error)) - { - if (invocation != NULL) -- g_dbus_method_invocation_take_error (invocation, error); -- else -- g_clear_error (&error); -+ g_dbus_method_invocation_return_gerror (invocation, error); - goto out; - } - } --- -2.31.1 - diff --git a/0004-udiskslinuxencrypted-Fix-GError-ownership.patch b/0004-udiskslinuxencrypted-Fix-GError-ownership.patch deleted file mode 100644 index 08a0bc28ba4fc9f3632191fb12532b2fd22e4550..0000000000000000000000000000000000000000 --- a/0004-udiskslinuxencrypted-Fix-GError-ownership.patch +++ /dev/null @@ -1,33 +0,0 @@ -From d6eb6f392b71ade4e8872618b1d11f24874376c8 Mon Sep 17 00:00:00 2001 -From: Tomas Bzatek -Date: Sat, 1 Jan 2022 22:01:49 +0100 -Subject: [PATCH 3/4] udiskslinuxencrypted: Fix GError ownership - ---- - src/udiskslinuxencrypted.c | 3 +-- - 1 file changed, 1 insertion(+), 2 deletions(-) - -diff --git a/src/udiskslinuxencrypted.c b/src/udiskslinuxencrypted.c -index c3a0821a..3bc54e69 100644 ---- a/src/udiskslinuxencrypted.c -+++ b/src/udiskslinuxencrypted.c -@@ -1040,7 +1040,7 @@ handle_resize (UDisksEncrypted *encrypted, - object = udisks_daemon_util_dup_object (encrypted, &error); - if (object == NULL) - { -- g_dbus_method_invocation_take_error (invocation, error); -+ g_dbus_method_invocation_return_gerror (invocation, error); - goto out; - } - -@@ -1066,7 +1066,6 @@ handle_resize (UDisksEncrypted *encrypted, - if (!udisks_daemon_util_get_caller_uid_sync (daemon, invocation, NULL /* GCancellable */, &caller_uid, &error)) - { - g_dbus_method_invocation_return_gerror (invocation, error); -- g_clear_error (&error); - goto out; - } - --- -2.31.1 - diff --git a/0005-udiskslinuxfilesystem-Fix-GError-ownership.patch b/0005-udiskslinuxfilesystem-Fix-GError-ownership.patch deleted file mode 100644 index 8f6dad7fa518e81741d5d00a4450b44afdab775b..0000000000000000000000000000000000000000 --- a/0005-udiskslinuxfilesystem-Fix-GError-ownership.patch +++ /dev/null @@ -1,52 +0,0 @@ -From 1886a5a4291f9aca1ee330659e2749b83b16030f Mon Sep 17 00:00:00 2001 -From: Tomas Bzatek -Date: Sat, 1 Jan 2022 22:02:17 +0100 -Subject: [PATCH 4/4] udiskslinuxfilesystem: Fix GError ownership - ---- - src/udiskslinuxfilesystem.c | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) - -diff --git a/src/udiskslinuxfilesystem.c b/src/udiskslinuxfilesystem.c -index f7c99757..a8390a04 100644 ---- a/src/udiskslinuxfilesystem.c -+++ b/src/udiskslinuxfilesystem.c -@@ -1739,7 +1739,7 @@ handle_resize (UDisksFilesystem *filesystem, - object = udisks_daemon_util_dup_object (filesystem, &error); - if (object == NULL) - { -- g_dbus_method_invocation_take_error (invocation, error); -+ g_dbus_method_invocation_return_gerror (invocation, error); - goto out; - } - -@@ -1921,7 +1921,7 @@ handle_repair (UDisksFilesystem *filesystem, - object = udisks_daemon_util_dup_object (filesystem, &error); - if (object == NULL) - { -- g_dbus_method_invocation_take_error (invocation, error); -+ g_dbus_method_invocation_return_gerror (invocation, error); - goto out; - } - -@@ -2089,7 +2089,7 @@ handle_check (UDisksFilesystem *filesystem, - object = udisks_daemon_util_dup_object (filesystem, &error); - if (object == NULL) - { -- g_dbus_method_invocation_take_error (invocation, error); -+ g_dbus_method_invocation_return_gerror (invocation, error); - goto out; - } - -@@ -2257,7 +2257,7 @@ handle_take_ownership (UDisksFilesystem *filesystem, - object = udisks_daemon_util_dup_object (filesystem, &error); - if (object == NULL) - { -- g_dbus_method_invocation_take_error (invocation, error); -+ g_dbus_method_invocation_return_gerror (invocation, error); - goto out; - } - --- -2.31.1 - diff --git a/udisks-2.10.90.tar.bz2 b/udisks-2.10.90.tar.bz2 new file mode 100644 index 0000000000000000000000000000000000000000..83bc539564db1551ba64b08de974c09fd6d70311 Binary files /dev/null and b/udisks-2.10.90.tar.bz2 differ diff --git a/udisks-2.11.0-lvm2-unused_device_detection-try_harder.patch b/udisks-2.11.0-lvm2-unused_device_detection-try_harder.patch new file mode 100644 index 0000000000000000000000000000000000000000..eac02656146311a5e460d3cf05f19906a4244777 --- /dev/null +++ b/udisks-2.11.0-lvm2-unused_device_detection-try_harder.patch @@ -0,0 +1,33 @@ +From d747e73aaec2c4e2cf124646230159e8b45a5da8 Mon Sep 17 00:00:00 2001 +From: Tomas Bzatek +Date: Tue, 5 Nov 2024 17:01:00 +0100 +Subject: [PATCH] lvm2: Try opening for unused device detection harder + +Though the voluntary BSD locks cannot be used here due to opening +O_EXCL already, let's make several attempts before bailing out. +--- + modules/lvm2/udiskslvm2daemonutil.c | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +diff --git a/modules/lvm2/udiskslvm2daemonutil.c b/modules/lvm2/udiskslvm2daemonutil.c +index b2131f9ca..32736d20f 100644 +--- a/modules/lvm2/udiskslvm2daemonutil.c ++++ b/modules/lvm2/udiskslvm2daemonutil.c +@@ -65,9 +65,16 @@ udisks_daemon_util_lvm2_block_is_unused (UDisksBlock *block, + { + const gchar *device_file; + int fd; ++ gint num_tries = 0; + + device_file = udisks_block_get_device (block); +- fd = open (device_file, O_RDONLY | O_EXCL); ++ ++ while ((fd = open (device_file, O_RDONLY | O_EXCL)) < 0) ++ { ++ g_usleep (100 * 1000); /* microseconds */ ++ if (num_tries++ > 10) ++ break; ++ } + if (fd < 0) + { + g_set_error (error, UDISKS_ERROR, UDISKS_ERROR_FAILED, diff --git a/udisks-2.11.0-mdraid-inhibit-locks.patch b/udisks-2.11.0-mdraid-inhibit-locks.patch new file mode 100644 index 0000000000000000000000000000000000000000..a7b68fbe5e00d43d4557ff4e7541da2f1775b44f --- /dev/null +++ b/udisks-2.11.0-mdraid-inhibit-locks.patch @@ -0,0 +1,1011 @@ +From 2a1ee3b5e105d5e42fe536df282d86f1b226245d Mon Sep 17 00:00:00 2001 +From: Tomas Bzatek +Date: Tue, 21 Jan 2025 19:08:56 +0100 +Subject: [PATCH 1/5] udisksdaemon: Add 'no_inhibit' argument for job creation + functions + +Avoid placing system inhibit lock if desired. +--- + src/udisksdaemon.c | 34 ++++++++++++++++++++++++++++------ + src/udisksdaemon.h | 15 +++++++++++---- + 2 files changed, 39 insertions(+), 10 deletions(-) + +diff --git a/src/udisksdaemon.c b/src/udisksdaemon.c +index d7505d8b..8769486b 100644 +--- a/src/udisksdaemon.c ++++ b/src/udisksdaemon.c +@@ -822,6 +822,7 @@ common_job (UDisksDaemon *daemon, + UDisksObject *object, + const gchar *job_operation, + uid_t job_started_by_uid, ++ gboolean no_inhibit, + gpointer job) + { + gchar *job_object_path; +@@ -832,9 +833,12 @@ common_job (UDisksDaemon *daemon, + job_data = g_new0 (JobData, 1); + job_data->daemon = g_object_ref (daemon); + /* register inhibitor to systemd logind while job is running */ +- operation_description = udisks_client_get_job_description_from_operation (job_operation); +- job_data->inhibit_cookie = udisks_daemon_util_inhibit_system_sync (operation_description); +- g_free (operation_description); ++ if (!no_inhibit) ++ { ++ operation_description = udisks_client_get_job_description_from_operation (job_operation); ++ job_data->inhibit_cookie = udisks_daemon_util_inhibit_system_sync (operation_description); ++ g_free (operation_description); ++ } + + if (object != NULL) + udisks_base_job_add_object (UDISKS_BASE_JOB (job), object); +@@ -863,6 +867,7 @@ common_job (UDisksDaemon *daemon, + * @object: (allow-none): A #UDisksObject to add to the job or %NULL. + * @job_operation: The operation for the job. + * @job_started_by_uid: The user who started the job. ++ * @no_inhibit: Avoid placing system inhibitor lock. + * @cancellable: A #GCancellable or %NULL. + * + * Launches a new simple job. +@@ -879,6 +884,7 @@ udisks_daemon_launch_simple_job (UDisksDaemon *daemon, + UDisksObject *object, + const gchar *job_operation, + uid_t job_started_by_uid, ++ gboolean no_inhibit, + GCancellable *cancellable) + { + UDisksSimpleJob *job; +@@ -886,7 +892,7 @@ udisks_daemon_launch_simple_job (UDisksDaemon *daemon, + g_return_val_if_fail (UDISKS_IS_DAEMON (daemon), NULL); + + job = udisks_simple_job_new (daemon, cancellable); +- return common_job (daemon, object, job_operation, job_started_by_uid, job); ++ return common_job (daemon, object, job_operation, job_started_by_uid, no_inhibit, job); + } + + /* ---------------------------------------------------------------------------------------------------- */ +@@ -897,6 +903,7 @@ udisks_daemon_launch_simple_job (UDisksDaemon *daemon, + * @object: (allow-none): A #UDisksObject to add to the job or %NULL. + * @job_operation: The operation for the job. + * @job_started_by_uid: The user who started the job. ++ * @no_inhibit: Avoid placing system inhibitor lock. + * @job_func: The function to run in another thread. + * @user_data: User data to pass to @job_func. + * @user_data_free_func: Function to free @user_data with or %NULL. +@@ -926,6 +933,7 @@ udisks_daemon_launch_threaded_job (UDisksDaemon *daemon, + UDisksObject *object, + const gchar *job_operation, + uid_t job_started_by_uid, ++ gboolean no_inhibit, + UDisksThreadedJobFunc job_func, + gpointer user_data, + GDestroyNotify user_data_free_func, +@@ -941,7 +949,7 @@ udisks_daemon_launch_threaded_job (UDisksDaemon *daemon, + user_data_free_func, + daemon, + cancellable); +- return common_job (daemon, object, job_operation, job_started_by_uid, job); ++ return common_job (daemon, object, job_operation, job_started_by_uid, no_inhibit, job); + } + + /* ---------------------------------------------------------------------------------------------------- */ +@@ -952,6 +960,7 @@ udisks_daemon_launch_threaded_job (UDisksDaemon *daemon, + * @object: (allow-none): A #UDisksObject to add to the job or %NULL. + * @job_operation: The operation for the job. + * @job_started_by_uid: The user who started the job. ++ * @no_inhibit: Avoid placing system inhibitor lock. + * @cancellable: A #GCancellable or %NULL. + * @run_as_uid: The #uid_t to run the command as. + * @run_as_euid: The effective #uid_t to run the command as. +@@ -980,6 +989,7 @@ udisks_daemon_launch_spawned_job (UDisksDaemon *daemon, + UDisksObject *object, + const gchar *job_operation, + uid_t job_started_by_uid, ++ gboolean no_inhibit, + GCancellable *cancellable, + uid_t run_as_uid, + uid_t run_as_euid, +@@ -1003,6 +1013,7 @@ udisks_daemon_launch_spawned_job (UDisksDaemon *daemon, + object, + job_operation, + job_started_by_uid, ++ no_inhibit, + cancellable, + run_as_uid, + run_as_euid, +@@ -1021,6 +1032,7 @@ udisks_daemon_launch_spawned_job (UDisksDaemon *daemon, + * @object: (allow-none): A #UDisksObject to add to the job or %NULL. + * @job_operation: The operation for the job. + * @job_started_by_uid: The user who started the job. ++ * @no_inhibit: Avoid placing system inhibitor lock. + * @cancellable: A #GCancellable or %NULL. + * @run_as_uid: The #uid_t to run the command as. + * @run_as_euid: The effective #uid_t to run the command as. +@@ -1054,6 +1066,7 @@ udisks_daemon_launch_spawned_job_gstring ( + UDisksObject *object, + const gchar *job_operation, + uid_t job_started_by_uid, ++ gboolean no_inhibit, + GCancellable *cancellable, + uid_t run_as_uid, + uid_t run_as_euid, +@@ -1075,7 +1088,7 @@ udisks_daemon_launch_spawned_job_gstring ( + job = udisks_spawned_job_new (command_line, input_string, run_as_uid, run_as_euid, daemon, cancellable); + g_free (command_line); + +- return common_job (daemon, object, job_operation, job_started_by_uid, job); ++ return common_job (daemon, object, job_operation, job_started_by_uid, no_inhibit, job); + } + + /* ---------------------------------------------------------------------------------------------------- */ +@@ -1120,6 +1133,7 @@ spawned_job_sync_on_completed (UDisksJob *job, + * @object: (allow-none): A #UDisksObject to add to the job or %NULL. + * @job_operation: The operation for the job. + * @job_started_by_uid: The user who started the job. ++ * @no_inhibit: Avoid placing system inhibitor lock. + * @cancellable: A #GCancellable or %NULL. + * @run_as_uid: The #uid_t to run the command as. + * @run_as_euid: The effective #uid_t to run the command as. +@@ -1139,6 +1153,7 @@ udisks_daemon_launch_spawned_job_sync (UDisksDaemon *daemon, + UDisksObject *object, + const gchar *job_operation, + uid_t job_started_by_uid, ++ gboolean no_inhibit, + GCancellable *cancellable, + uid_t run_as_uid, + uid_t run_as_euid, +@@ -1164,6 +1179,7 @@ udisks_daemon_launch_spawned_job_sync (UDisksDaemon *daemon, + object, + job_operation, + job_started_by_uid, ++ no_inhibit, + cancellable, + run_as_uid, + run_as_euid, +@@ -1184,6 +1200,7 @@ udisks_daemon_launch_spawned_job_sync (UDisksDaemon *daemon, + * @object: (allow-none): A #UDisksObject to add to the job or %NULL. + * @job_operation: The operation for the job. + * @job_started_by_uid: The user who started the job. ++ * @no_inhibit: Avoid placing system inhibitor lock. + * @cancellable: A #GCancellable or %NULL. + * @run_as_uid: The #uid_t to run the command as. + * @run_as_euid: The effective #uid_t to run the command as. +@@ -1207,6 +1224,7 @@ udisks_daemon_launch_spawned_job_gstring_sync (UDisksDaemon *daemon, + UDisksObject *object, + const gchar *job_operation, + uid_t job_started_by_uid, ++ gboolean no_inhibit, + GCancellable *cancellable, + uid_t run_as_uid, + uid_t run_as_euid, +@@ -1239,6 +1257,7 @@ udisks_daemon_launch_spawned_job_gstring_sync (UDisksDaemon *daemon, + object, + job_operation, + job_started_by_uid, ++ no_inhibit, + cancellable, + run_as_uid, + run_as_euid, +@@ -1318,6 +1337,7 @@ udisks_bd_thread_disable_progress (void) + * @object: (allow-none): A #UDisksObject to add to the job or %NULL. + * @job_operation: The operation for the job. + * @job_started_by_uid: The user who started the job. ++ * @no_inhibit: Avoid placing system inhibitor lock. + * @job_func: The function to run in another thread. + * @user_data: User data to pass to @job_func. + * @user_data_free_func: Function to free @user_data with or %NULL. +@@ -1334,6 +1354,7 @@ udisks_daemon_launch_threaded_job_sync (UDisksDaemon *daemon, + UDisksObject *object, + const gchar *job_operation, + uid_t job_started_by_uid, ++ gboolean no_inhibit, + UDisksThreadedJobFunc job_func, + gpointer user_data, + GDestroyNotify user_data_free_func, +@@ -1350,6 +1371,7 @@ udisks_daemon_launch_threaded_job_sync (UDisksDaemon *daemon, + object, + job_operation, + job_started_by_uid, ++ no_inhibit, + job_func, + user_data, + user_data_free_func, +diff --git a/src/udisksdaemon.h b/src/udisksdaemon.h +index 2edbaf3a..2f612c67 100644 +--- a/src/udisksdaemon.h ++++ b/src/udisksdaemon.h +@@ -110,21 +110,24 @@ UDisksBaseJob *udisks_daemon_launch_simple_job (UDisksDaemon * + UDisksObject *object, + const gchar *job_operation, + uid_t job_started_by_uid, ++ gboolean no_inhibit, + GCancellable *cancellable); + UDisksBaseJob *udisks_daemon_launch_spawned_job (UDisksDaemon *daemon, + UDisksObject *object, + const gchar *job_operation, + uid_t job_started_by_uid, ++ gboolean no_inhibit, + GCancellable *cancellable, + uid_t run_as_uid, + uid_t run_as_euid, + const gchar *input_string, + const gchar *command_line_format, +- ...) G_GNUC_PRINTF (9, 10); ++ ...) G_GNUC_PRINTF (10, 11); + gboolean udisks_daemon_launch_spawned_job_sync (UDisksDaemon *daemon, + UDisksObject *object, + const gchar *job_operation, + uid_t job_started_by_uid, ++ gboolean no_inhibit, + GCancellable *cancellable, + uid_t run_as_uid, + uid_t run_as_euid, +@@ -132,21 +135,23 @@ gboolean udisks_daemon_launch_spawned_job_sync (UDisksDaemon + gchar **out_message, + const gchar *input_string, + const gchar *command_line_format, +- ...) G_GNUC_PRINTF (11, 12); ++ ...) G_GNUC_PRINTF (12, 13); + UDisksBaseJob *udisks_daemon_launch_spawned_job_gstring (UDisksDaemon *daemon, + UDisksObject *object, + const gchar *job_operation, + uid_t job_started_by_uid, ++ gboolean no_inhibit, + GCancellable *cancellable, + uid_t run_as_uid, + uid_t run_as_euid, + GString *input_string, + const gchar *command_line_format, +- ...) G_GNUC_PRINTF (9, 10); ++ ...) G_GNUC_PRINTF (10, 11); + gboolean udisks_daemon_launch_spawned_job_gstring_sync (UDisksDaemon *daemon, + UDisksObject *object, + const gchar *job_operation, + uid_t job_started_by_uid, ++ gboolean no_inhibit, + GCancellable *cancellable, + uid_t run_as_uid, + uid_t run_as_euid, +@@ -154,11 +159,12 @@ gboolean udisks_daemon_launch_spawned_job_gstring_sync (UDisksD + gchar **out_message, + GString *input_string, + const gchar *command_line_format, +- ...) G_GNUC_PRINTF (11, 12); ++ ...) G_GNUC_PRINTF (12, 13); + UDisksBaseJob *udisks_daemon_launch_threaded_job (UDisksDaemon *daemon, + UDisksObject *object, + const gchar *job_operation, + uid_t job_started_by_uid, ++ gboolean no_inhibit, + UDisksThreadedJobFunc job_func, + gpointer user_data, + GDestroyNotify user_data_free_func, +@@ -168,6 +174,7 @@ gboolean udisks_daemon_launch_threaded_job_sync (UDisksDaemon + UDisksObject *object, + const gchar *job_operation, + uid_t job_started_by_uid, ++ gboolean no_inhibit, + UDisksThreadedJobFunc job_func, + gpointer user_data, + GDestroyNotify user_data_free_func, +-- +2.48.1 + +From 322863e6b49ae011b8d2f1e2c8741f56dabbb5f3 Mon Sep 17 00:00:00 2001 +From: Tomas Bzatek +Date: Tue, 21 Jan 2025 19:15:45 +0100 +Subject: [PATCH 2/5] daemon: Align to the no_inhibit job argument change + +--- + src/udiskslinuxblock.c | 7 ++++++- + src/udiskslinuxdrive.c | 1 + + src/udiskslinuxdriveata.c | 3 ++- + src/udiskslinuxencrypted.c | 6 ++++++ + src/udiskslinuxfilesystem.c | 10 ++++++++++ + src/udiskslinuxloop.c | 1 + + src/udiskslinuxmanager.c | 1 + + src/udiskslinuxmdraid.c | 7 +++++++ + src/udiskslinuxnvmecontroller.c | 2 ++ + src/udiskslinuxnvmenamespace.c | 1 + + src/udiskslinuxpartition.c | 6 ++++++ + src/udiskslinuxpartitiontable.c | 1 + + src/udiskslinuxswapspace.c | 4 ++++ + src/udisksstate.c | 2 ++ + 14 files changed, 50 insertions(+), 2 deletions(-) + +diff --git a/src/udiskslinuxblock.c b/src/udiskslinuxblock.c +index 5b5588b2..008d1265 100644 +--- a/src/udiskslinuxblock.c ++++ b/src/udiskslinuxblock.c +@@ -2482,7 +2482,7 @@ erase_device (UDisksBlock *block, + goto out; + } + +- job = udisks_daemon_launch_simple_job (daemon, object, "format-erase", caller_uid, NULL); ++ job = udisks_daemon_launch_simple_job (daemon, object, "format-erase", caller_uid, FALSE, NULL); + udisks_base_job_set_auto_estimate (UDISKS_BASE_JOB (job), TRUE); + udisks_job_set_progress_valid (UDISKS_JOB (job), TRUE); + +@@ -3185,6 +3185,7 @@ format_create_luks (UDisksDaemon *daemon, + object, + "format-mkfs", + caller_uid, ++ FALSE, + luks_format_job_func, + &crypto_job_data, + NULL, /* user_data_free_func */ +@@ -3229,6 +3230,7 @@ format_create_luks (UDisksDaemon *daemon, + object, + "format-mkfs", + caller_uid, ++ FALSE, + luks_open_job_func, + &crypto_job_data, + NULL, /* user_data_free_func */ +@@ -3571,6 +3573,7 @@ udisks_linux_block_handle_format (UDisksBlock *block, + object, + "format-mkfs", + caller_uid, ++ FALSE, + format_job_func, + &format_job_data, + NULL, /* user_data_free_func */ +@@ -3679,6 +3682,7 @@ udisks_linux_block_handle_format (UDisksBlock *block, + object, + "format-mkfs", + caller_uid, ++ FALSE, + format_job_func, + &format_job_data, + NULL, /* user_data_free_func */ +@@ -4268,6 +4272,7 @@ handle_restore_encrypted_header (UDisksBlock *encrypted, + UDISKS_OBJECT (object), + "block-restore-encrypted-header", + caller_uid, ++ FALSE, + NULL); + if (job == NULL) + { +diff --git a/src/udiskslinuxdrive.c b/src/udiskslinuxdrive.c +index 18b9ae4f..93ca3813 100644 +--- a/src/udiskslinuxdrive.c ++++ b/src/udiskslinuxdrive.c +@@ -1142,6 +1142,7 @@ handle_eject (UDisksDrive *_drive, + if (!udisks_daemon_launch_spawned_job_sync (daemon, + UDISKS_OBJECT (object), + "drive-eject", caller_uid, ++ FALSE, + NULL, /* GCancellable */ + 0, /* uid_t run_as_uid */ + 0, /* uid_t run_as_euid */ +diff --git a/src/udiskslinuxdriveata.c b/src/udiskslinuxdriveata.c +index 0675d1ed..dd7b0b0d 100644 +--- a/src/udiskslinuxdriveata.c ++++ b/src/udiskslinuxdriveata.c +@@ -1194,6 +1194,7 @@ handle_smart_selftest_start (UDisksDriveAta *_drive, + drive->selftest_job = UDISKS_THREADED_JOB (udisks_daemon_launch_threaded_job (daemon, + UDISKS_OBJECT (object), + "ata-smart-selftest", caller_uid, ++ FALSE, + selftest_job_func, + g_object_ref (drive), + g_object_unref, +@@ -2226,7 +2227,7 @@ udisks_linux_drive_ata_secure_erase_sync (UDisksLinuxDriveAta *drive, + job = udisks_daemon_launch_simple_job (daemon, + UDISKS_OBJECT (object), + enhanced ? "ata-enhanced-secure-erase" : "ata-secure-erase", +- caller_uid, NULL); ++ caller_uid, FALSE, NULL); + udisks_job_set_cancelable (UDISKS_JOB (job), FALSE); + + /* A value of 510 (255 in the IDENTIFY DATA register) means "erase +diff --git a/src/udiskslinuxencrypted.c b/src/udiskslinuxencrypted.c +index f6ae85c7..bb1f9e10 100644 +--- a/src/udiskslinuxencrypted.c ++++ b/src/udiskslinuxencrypted.c +@@ -588,6 +588,7 @@ handle_unlock (UDisksEncrypted *encrypted, + object, + "encrypted-unlock", + caller_uid, ++ FALSE, + open_func, + &data, + NULL, /* user_data_free_func */ +@@ -807,6 +808,7 @@ udisks_linux_encrypted_lock (UDisksLinuxEncrypted *encrypted, + object, + "encrypted-lock", + caller_uid, ++ FALSE, + close_func, + &data, + NULL, /* user_data_free_func */ +@@ -991,6 +993,7 @@ handle_change_passphrase (UDisksEncrypted *encrypted, + object, + "encrypted-modify", + caller_uid, ++ FALSE, + luks_change_key_job_func, + &data, + NULL, /* user_data_free_func */ +@@ -1155,6 +1158,7 @@ handle_resize (UDisksEncrypted *encrypted, + UDISKS_OBJECT (object), + "encrypted-resize", + caller_uid, ++ FALSE, + NULL); + if (job == NULL) + { +@@ -1296,6 +1300,7 @@ handle_convert (UDisksEncrypted *encrypted, + UDISKS_OBJECT (object), + "encrypted-convert", + caller_uid, ++ FALSE, + NULL); + if (job == NULL) + { +@@ -1389,6 +1394,7 @@ handle_header_backup (UDisksEncrypted *encrypted, + UDISKS_OBJECT (object), + "encrypted-header-backup", + caller_uid, ++ FALSE, + NULL); + if (job == NULL) + { +diff --git a/src/udiskslinuxfilesystem.c b/src/udiskslinuxfilesystem.c +index e7df067d..b1974483 100644 +--- a/src/udiskslinuxfilesystem.c ++++ b/src/udiskslinuxfilesystem.c +@@ -983,6 +983,7 @@ handle_mount_fstab (UDisksDaemon *daemon, + UDISKS_OBJECT (object), + "filesystem-mount", + mount_fstab_as_root ? 0 : caller_uid, ++ FALSE, + NULL /* cancellable */); + + /* XXX: using run_as_uid for root doesn't work even if the caller is already root */ +@@ -1208,6 +1209,7 @@ handle_mount_dynamic (UDisksDaemon *daemon, + UDISKS_OBJECT (object), + "filesystem-mount", + 0, ++ FALSE, + NULL /* cancellable */); + + success = FALSE; +@@ -1564,6 +1566,7 @@ handle_unmount (UDisksFilesystem *filesystem, + UDISKS_OBJECT (object), + "filesystem-unmount", + unmount_fstab_as_root ? 0 : caller_uid, ++ FALSE, + NULL); + + if (!unmount_fstab_as_root && caller_uid != 0) +@@ -1669,6 +1672,7 @@ handle_unmount (UDisksFilesystem *filesystem, + UDISKS_OBJECT (object), + "filesystem-unmount", + 0, ++ FALSE, + NULL); + + if (!bd_fs_unmount (mount_point ? mount_point : udisks_block_get_device (block), +@@ -1850,6 +1854,7 @@ handle_set_label (UDisksFilesystem *filesystem, + object, + "filesystem-modify", + caller_uid, ++ FALSE, + NULL /* cancellable */); + if (job == NULL) + { +@@ -2030,6 +2035,7 @@ handle_resize (UDisksFilesystem *filesystem, + UDISKS_OBJECT (object), + "filesystem-resize", + caller_uid, ++ FALSE, + NULL); + if (job == NULL) + { +@@ -2201,6 +2207,7 @@ handle_repair (UDisksFilesystem *filesystem, + UDISKS_OBJECT (object), + "filesystem-repair", + caller_uid, ++ FALSE, + NULL); + if (job == NULL) + { +@@ -2369,6 +2376,7 @@ handle_check (UDisksFilesystem *filesystem, + UDISKS_OBJECT (object), + "filesystem-check", + caller_uid, ++ FALSE, + NULL); + if (job == NULL) + { +@@ -2518,6 +2526,7 @@ handle_take_ownership (UDisksFilesystem *filesystem, + UDISKS_OBJECT (object), + "filesystem-modify", + caller_uid, ++ FALSE, + NULL); + if (job == NULL) + { +@@ -2698,6 +2707,7 @@ handle_set_uuid (UDisksFilesystem *filesystem, + object, + "filesystem-modify", + caller_uid, ++ FALSE, + NULL /* cancellable */); + if (job == NULL) + { +diff --git a/src/udiskslinuxloop.c b/src/udiskslinuxloop.c +index 500df6ef..ee690991 100644 +--- a/src/udiskslinuxloop.c ++++ b/src/udiskslinuxloop.c +@@ -249,6 +249,7 @@ handle_delete (UDisksLoop *loop, + UDISKS_OBJECT(object), + "loop-setup", + caller_uid, ++ FALSE, + NULL); + + if (job == NULL) +diff --git a/src/udiskslinuxmanager.c b/src/udiskslinuxmanager.c +index 139be7ca..4e633284 100644 +--- a/src/udiskslinuxmanager.c ++++ b/src/udiskslinuxmanager.c +@@ -598,6 +598,7 @@ handle_mdraid_create (UDisksManager *_object, + NULL, + "mdraid-create", + caller_uid, ++ FALSE, + NULL); + + if (job == NULL) +diff --git a/src/udiskslinuxmdraid.c b/src/udiskslinuxmdraid.c +index 176b0258..a24c78c2 100644 +--- a/src/udiskslinuxmdraid.c ++++ b/src/udiskslinuxmdraid.c +@@ -371,6 +371,7 @@ udisks_linux_mdraid_update (UDisksLinuxMDRaid *mdraid, + UDISKS_OBJECT (object), + sync_action_to_job_id (sync_action), + 0, ++ FALSE, + NULL /* cancellable */); + + /* Mark the job as not cancellable. It simply has to finish... */ +@@ -643,6 +644,7 @@ handle_start (UDisksMDRaid *_mdraid, + UDISKS_OBJECT (object), + "md-raid-start", + caller_uid, ++ FALSE, + NULL); + + if (job == NULL) +@@ -805,6 +807,7 @@ udisks_linux_mdraid_stop (UDisksMDRaid *_mdraid, + UDISKS_OBJECT (object), + "md-raid-stop", + caller_uid, ++ FALSE, + NULL); + + if (job == NULL) +@@ -1026,6 +1029,7 @@ handle_remove_device (UDisksMDRaid *_mdraid, + UDISKS_OBJECT (object), + "md-raid-remove-device", + caller_uid, ++ FALSE, + NULL); + + if (job == NULL) +@@ -1170,6 +1174,7 @@ handle_add_device (UDisksMDRaid *_mdraid, + UDISKS_OBJECT (object), + "md-raid-add-device", + caller_uid, ++ FALSE, + NULL); + + if (job == NULL) +@@ -1286,6 +1291,7 @@ handle_set_bitmap_location (UDisksMDRaid *_mdraid, + UDISKS_OBJECT (object), + "md-raid-set-bitmap", + caller_uid, ++ FALSE, + NULL); + + if (job == NULL) +@@ -1403,6 +1409,7 @@ handle_request_sync_action (UDisksMDRaid *_mdraid, + UDISKS_OBJECT (object), + sync_action_to_job_id (sync_action), + caller_uid, ++ FALSE, + NULL); + + if (job == NULL) +diff --git a/src/udiskslinuxnvmecontroller.c b/src/udiskslinuxnvmecontroller.c +index b032467e..dff3ab06 100644 +--- a/src/udiskslinuxnvmecontroller.c ++++ b/src/udiskslinuxnvmecontroller.c +@@ -873,6 +873,7 @@ handle_smart_selftest_start (UDisksNVMeController *_ctrl, + UDISKS_OBJECT (object), + "nvme-selftest", + caller_uid, ++ FALSE, + selftest_job_func, + g_object_ref (ctrl), + (GDestroyNotify) selftest_job_func_done, +@@ -1298,6 +1299,7 @@ handle_sanitize_start (UDisksNVMeController *_object, + UDISKS_OBJECT (object), + "nvme-sanitize", + caller_uid, ++ FALSE, + sanitize_job_func, + g_object_ref (ctrl), + (GDestroyNotify) sanitize_job_func_done, +diff --git a/src/udiskslinuxnvmenamespace.c b/src/udiskslinuxnvmenamespace.c +index 076c2285..ddb03e22 100644 +--- a/src/udiskslinuxnvmenamespace.c ++++ b/src/udiskslinuxnvmenamespace.c +@@ -429,6 +429,7 @@ handle_format_namespace (UDisksNVMeNamespace *_ns, + UDISKS_OBJECT (object), + "nvme-format-ns", + caller_uid, ++ FALSE, + format_ns_job_func, + data, + (GDestroyNotify) format_ns_job_func_done, +diff --git a/src/udiskslinuxpartition.c b/src/udiskslinuxpartition.c +index c4433627..2e07ca2c 100644 +--- a/src/udiskslinuxpartition.c ++++ b/src/udiskslinuxpartition.c +@@ -389,6 +389,7 @@ handle_set_flags (UDisksPartition *partition, + UDISKS_OBJECT (object), + "partition-modify", + caller_uid, ++ FALSE, + NULL); + + if (job == NULL) +@@ -527,6 +528,7 @@ handle_set_name (UDisksPartition *partition, + UDISKS_OBJECT (object), + "partition-modify", + caller_uid, ++ FALSE, + NULL); + + if (job == NULL) +@@ -669,6 +671,7 @@ handle_set_uuid (UDisksPartition *partition, + UDISKS_OBJECT (object), + "partition-modify", + caller_uid, ++ FALSE, + NULL); + + if (job == NULL) +@@ -774,6 +777,7 @@ udisks_linux_partition_set_type_sync (UDisksLinuxPartition *partition, + UDISKS_OBJECT (object), + "partition-modify", + caller_uid, ++ FALSE, + NULL); + + if (job == NULL) +@@ -984,6 +988,7 @@ handle_resize (UDisksPartition *partition, + UDISKS_OBJECT (object), + "partition-modify", + caller_uid, ++ FALSE, + NULL); + + if (job == NULL) +@@ -1115,6 +1120,7 @@ handle_delete (UDisksPartition *partition, + UDISKS_OBJECT (object), + "partition-delete", + caller_uid, ++ FALSE, + NULL); + + if (job == NULL) +diff --git a/src/udiskslinuxpartitiontable.c b/src/udiskslinuxpartitiontable.c +index 528b22ff..09bd545b 100644 +--- a/src/udiskslinuxpartitiontable.c ++++ b/src/udiskslinuxpartitiontable.c +@@ -422,6 +422,7 @@ udisks_linux_partition_table_handle_create_partition (UDisksPartitionTable *ta + UDISKS_OBJECT (object), + "partition-create", + caller_uid, ++ FALSE, + NULL); + + if (job == NULL) +diff --git a/src/udiskslinuxswapspace.c b/src/udiskslinuxswapspace.c +index 0c4fd9a4..4c51bd88 100644 +--- a/src/udiskslinuxswapspace.c ++++ b/src/udiskslinuxswapspace.c +@@ -201,6 +201,7 @@ handle_start (UDisksSwapspace *swapspace, + object, + "swapspace-start", + caller_uid, ++ FALSE, + start_job_func, + object, + NULL, /* user_data_free_func */ +@@ -299,6 +300,7 @@ handle_stop (UDisksSwapspace *swapspace, + object, + "swapspace-stop", + caller_uid, ++ FALSE, + stop_job_func, + object, + NULL, /* user_data_free_func */ +@@ -376,6 +378,7 @@ handle_set_label (UDisksSwapspace *swapspace, + UDISKS_OBJECT (object), + "swapspace-modify", + caller_uid, ++ FALSE, + NULL); + if (job == NULL) + { +@@ -462,6 +465,7 @@ handle_set_uuid (UDisksSwapspace *swapspace, + UDISKS_OBJECT (object), + "swapspace-modify", + caller_uid, ++ FALSE, + NULL); + if (job == NULL) + { +diff --git a/src/udisksstate.c b/src/udisksstate.c +index df6ef337..7323036d 100644 +--- a/src/udisksstate.c ++++ b/src/udisksstate.c +@@ -783,6 +783,7 @@ udisks_state_check_mounted_fs_entry (UDisksState *state, + if (!udisks_daemon_launch_spawned_job_sync (state->daemon, + NULL, /* UDisksObject */ + "cleanup", 0, /* StartedByUID */ ++ FALSE, + NULL, /* GCancellable */ + 0, /* uid_t run_as_uid */ + 0, /* uid_t run_as_euid */ +@@ -1247,6 +1248,7 @@ udisks_state_check_unlocked_crypto_dev_entry (UDisksState *state, + NULL, /* UDisksObject */ + "cleanup", + 0, /* StartedByUID */ ++ FALSE, + luks_close_job_func, + &data, + NULL, /* user_data_free_func */ +-- +2.48.1 + +From 6d3ca4c21d3a9724aab4c021cc9c5c0b3fc39a1e Mon Sep 17 00:00:00 2001 +From: Tomas Bzatek +Date: Tue, 21 Jan 2025 19:16:11 +0100 +Subject: [PATCH 3/5] lvm2: Align to the no_inhibit job argument change + +--- + modules/lvm2/udiskslinuxlogicalvolume.c | 9 +++++++++ + modules/lvm2/udiskslinuxmanagerlvm2.c | 2 ++ + modules/lvm2/udiskslinuxvdovolume.c | 2 ++ + modules/lvm2/udiskslinuxvolumegroup.c | 8 ++++++++ + 4 files changed, 21 insertions(+) + +diff --git a/modules/lvm2/udiskslinuxlogicalvolume.c b/modules/lvm2/udiskslinuxlogicalvolume.c +index c0c43c03..f517f7cc 100644 +--- a/modules/lvm2/udiskslinuxlogicalvolume.c ++++ b/modules/lvm2/udiskslinuxlogicalvolume.c +@@ -593,6 +593,7 @@ handle_delete (UDisksLogicalVolume *_volume, + UDISKS_OBJECT (object), + "lvm-lvol-delete", + caller_uid, ++ FALSE, + lvremove_job_func, + &data, + NULL, /* user_data_free_func */ +@@ -669,6 +670,7 @@ handle_repair (UDisksLogicalVolume *_volume, + UDISKS_OBJECT (object), + "lvm-lvol-repair", + caller_uid, ++ FALSE, + lvrepair_job_func, + &data, + NULL, /* user_data_free_func */ +@@ -766,6 +768,7 @@ handle_rename (UDisksLogicalVolume *_volume, + UDISKS_OBJECT (object), + "lvm-lvol-rename", + caller_uid, ++ FALSE, + lvrename_job_func, + &data, + NULL, /* user_data_free_func */ +@@ -848,6 +851,7 @@ handle_resize (UDisksLogicalVolume *_volume, + UDISKS_OBJECT (object), + "lvm-lvol-resize", + caller_uid, ++ FALSE, + lvresize_job_func, + &data, + NULL, /* user_data_free_func */ +@@ -937,6 +941,7 @@ handle_activate (UDisksLogicalVolume *_volume, + UDISKS_OBJECT (object), + "lvm-lvol-activate", + caller_uid, ++ FALSE, + lvactivate_job_func, + &data, + NULL, /* user_data_free_func */ +@@ -1005,6 +1010,7 @@ handle_deactivate (UDisksLogicalVolume *_volume, + UDISKS_OBJECT (object), + "lvm-lvol-deactivate", + caller_uid, ++ FALSE, + lvdeactivate_job_func, + &data, + NULL, /* user_data_free_func */ +@@ -1074,6 +1080,7 @@ handle_create_snapshot (UDisksLogicalVolume *_volume, + UDISKS_OBJECT (object), + "lvm-lvol-snapshot", + caller_uid, ++ FALSE, + lvsnapshot_create_job_func, + &data, + NULL, /* user_data_free_func */ +@@ -1134,6 +1141,7 @@ handle_cache_attach (UDisksLogicalVolume *volume_, + UDISKS_OBJECT (object), + "lvm-lv-make-cache", + caller_uid, ++ FALSE, + lvcache_attach_job_func, + &data, + NULL, /* user_data_free_func */ +@@ -1185,6 +1193,7 @@ handle_cache_detach_or_split (UDisksLogicalVolume *volume_, + UDISKS_OBJECT (object), + "lvm-lv-split-cache", + caller_uid, ++ FALSE, + lvcache_detach_job_func, + &data, + NULL, /* user_data_free_func */ +diff --git a/modules/lvm2/udiskslinuxmanagerlvm2.c b/modules/lvm2/udiskslinuxmanagerlvm2.c +index 5c06b921..7cd96384 100644 +--- a/modules/lvm2/udiskslinuxmanagerlvm2.c ++++ b/modules/lvm2/udiskslinuxmanagerlvm2.c +@@ -338,6 +338,7 @@ handle_volume_group_create (UDisksManagerLVM2 *_object, + NULL, + "lvm-pv-create", + caller_uid, ++ FALSE, + pvcreate_job_func, + &pv_data, + NULL, /* user_data_free_func */ +@@ -363,6 +364,7 @@ handle_volume_group_create (UDisksManagerLVM2 *_object, + NULL, + "lvm-vg-create", + caller_uid, ++ FALSE, + vgcreate_job_func, + &data, + NULL, /* user_data_free_func */ +diff --git a/modules/lvm2/udiskslinuxvdovolume.c b/modules/lvm2/udiskslinuxvdovolume.c +index 19164d96..64247dfc 100644 +--- a/modules/lvm2/udiskslinuxvdovolume.c ++++ b/modules/lvm2/udiskslinuxvdovolume.c +@@ -262,6 +262,7 @@ _set_compression_deduplication (UDisksVDOVolume *_volume, + UDISKS_OBJECT (object), + "lvm-vdo-dedup-comp", + caller_uid, ++ FALSE, + compression ? lv_vdo_compression_job_func : lv_vdo_deduplication_job_func, + &data, + NULL, /* user_data_free_func */ +@@ -340,6 +341,7 @@ _vdo_resize (UDisksLinuxLogicalVolumeObject *object, + UDISKS_OBJECT (object), + "lvm-lvol-resize", + caller_uid, ++ FALSE, + lvresize_job_func, + &data, + NULL, /* user_data_free_func */ +diff --git a/modules/lvm2/udiskslinuxvolumegroup.c b/modules/lvm2/udiskslinuxvolumegroup.c +index 5cb904e2..e1c6d76e 100644 +--- a/modules/lvm2/udiskslinuxvolumegroup.c ++++ b/modules/lvm2/udiskslinuxvolumegroup.c +@@ -336,6 +336,7 @@ handle_delete (UDisksVolumeGroup *_group, + UDISKS_OBJECT (object), + "lvm-vg-delete", + caller_uid, ++ FALSE, + vgremove_job_func, + &data, + NULL, /* user_data_free_func */ +@@ -457,6 +458,7 @@ handle_rename (UDisksVolumeGroup *_group, + UDISKS_OBJECT (object), + "lvm-vg-rename", + caller_uid, ++ FALSE, + vgrename_job_func, + &data, + NULL, /* user_data_free_func */ +@@ -585,6 +587,7 @@ handle_add_device (UDisksVolumeGroup *_group, + UDISKS_OBJECT (object), + "lvm-pv-create", + caller_uid, ++ FALSE, + pvcreate_job_func, + &pv_data, + NULL, /* user_data_free_func */ +@@ -610,6 +613,7 @@ handle_add_device (UDisksVolumeGroup *_group, + UDISKS_OBJECT (object), + "lvm-vg-add-device", + caller_uid, ++ FALSE, + vgextend_job_func, + &data, + NULL, /* user_data_free_func */ +@@ -729,6 +733,7 @@ handle_remove_common (UDisksVolumeGroup *_group, + UDISKS_OBJECT (object), + job_operation, + caller_uid, ++ FALSE, + job_func, + &data, + NULL, /* user_data_free_func */ +@@ -751,6 +756,7 @@ handle_remove_common (UDisksVolumeGroup *_group, + UDISKS_OBJECT (object), + "pv-format-erase", + caller_uid, ++ FALSE, + pvremove_job_func, + &data, + NULL, /* user_data_free_func */ +@@ -854,6 +860,7 @@ handle_remove_missing_physical_volumes (UDisksVolumeGroup *_group, + UDISKS_OBJECT (object), + "lvm-vg-rem-device", + caller_uid, ++ FALSE, + vgreduce_job_func, + &data, + NULL, /* user_data_free_func */ +@@ -1098,6 +1105,7 @@ handle_create_volume (UDisksVolumeGroup *_group, + UDISKS_OBJECT (object), + "lvm-vg-create-volume", + caller_uid, ++ FALSE, + create_function, + &data, + NULL, /* user_data_free_func */ +-- +2.48.1 + +From 6e8948401251f60e5cd8989ec4992974b375f4ed Mon Sep 17 00:00:00 2001 +From: Tomas Bzatek +Date: Tue, 21 Jan 2025 19:19:05 +0100 +Subject: [PATCH 4/5] udiskslinuxmdraid: Avoid putting inhibit lock for + externally started operations + +UDisks publishes a new job object whenever it sees an array in sync, +repair or generally any other operation running. However this involves +acquiring and holding a system inhibit lock for the whole duration +of the operation, which for large disks may take hours or days. +Besides, mdraid resync is a restartable operation, defeating the purpose +for an inhibit lock. + +This is also causing problems for installation environments where +UDisks is blocking post-installation reboot until the operation is done. +--- + src/udiskslinuxmdraid.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/udiskslinuxmdraid.c b/src/udiskslinuxmdraid.c +index a24c78c2..0ca9d681 100644 +--- a/src/udiskslinuxmdraid.c ++++ b/src/udiskslinuxmdraid.c +@@ -371,8 +371,8 @@ udisks_linux_mdraid_update (UDisksLinuxMDRaid *mdraid, + UDISKS_OBJECT (object), + sync_action_to_job_id (sync_action), + 0, +- FALSE, +- NULL /* cancellable */); ++ TRUE, /* no_inhibit */ ++ NULL /* cancellable */); + + /* Mark the job as not cancellable. It simply has to finish... */ + udisks_job_set_cancelable (UDISKS_JOB (job), FALSE); +-- +2.48.1 + diff --git a/udisks-2.9.4.tar.bz2 b/udisks-2.9.4.tar.bz2 deleted file mode 100644 index d59b57ccbb0d2dc25aa00059dd47416abd1d8969..0000000000000000000000000000000000000000 Binary files a/udisks-2.9.4.tar.bz2 and /dev/null differ diff --git a/udisks2.spec b/udisks2.spec index 1514a9ddf72ccef93ac715d94a1f7d0fcc53a935..6e7da845aa4d48a8cd23bb513b24a576428ae7f1 100644 --- a/udisks2.spec +++ b/udisks2.spec @@ -1,18 +1,16 @@ -%define anolis_release 6 +%define anolis_release 1 Name: udisks2 -Version: 2.9.4 +Version: 2.10.90 Release: %{anolis_release}%{?dist} Summary: Disk Manager License: GPLv2+ URL: https://github.com/storaged-project/udisks Source0: https://github.com/storaged-project/udisks/releases/download/udisks-%{version}/udisks-%{version}.tar.bz2 -Patch1: 0001-udiskslinuxmountoptions-Do-not-free-static-daemon-resources.patch -Patch2: 0002-udiskslinuxpartitiontable-Fix-GError-ownership.patch -Patch3: 0003-udiskslinuxpartition-Fix-GError-ownership.patch -Patch4: 0004-udiskslinuxencrypted-Fix-GError-ownership.patch -Patch5: 0005-udiskslinuxfilesystem-Fix-GError-ownership.patch + +Patch1: udisks-2.11.0-lvm2-unused_device_detection-try_harder.patch +Patch2: udisks-2.11.0-mdraid-inhibit-locks.patch BuildRequires: libtool @@ -36,6 +34,8 @@ BuildRequires: libblockdev-swap-devel BuildRequires: libblockdev-mdraid-devel BuildRequires: libblockdev-fs-devel BuildRequires: libblockdev-crypto-devel +BuildRequires: libblockdev-nvme-devel +BuildRequires: libblockdev-smart-devel BuildRequires: libmount-devel BuildRequires: libuuid-devel @@ -46,6 +46,8 @@ Requires: libblockdev-swap Requires: libblockdev-mdraid Requires: libblockdev-fs Requires: libblockdev-crypto +Requires: libblockdev-nvme +Requires: libblockdev-smart Requires: dbus Requires: udev Requires: libatasmart @@ -61,7 +63,7 @@ Requires: libmount Requires: lib%{name} = %{version}-%{release} Provides: storaged = %{version}-%{release} -Obsoletes: storaged +Obsoletes: storaged < %{version}-%{release} %description The UDisks project provides a daemon, tools and libraries to access and @@ -79,7 +81,7 @@ The %{name}-doc package contains documentation files for %{name}. Summary: Dynamic library to access the udisksd daemon License: LGPLv2+ Provides: libstoraged = %{version}-%{release} -Obsoletes: libstoraged +Obsoletes: libstoraged < %{version}-%{release} %description -n lib%{name} This package contains the dynamic library, which provides access to the @@ -90,7 +92,7 @@ Summary: Development files for lib%{name} License: LGPLv2+ Requires: lib%{name} = %{version}-%{release} Provides: libstoraged-devel = %{version}-%{release} -Obsoletes: libstoraged-devel +Obsoletes: libstoraged-devel < %{version}-%{release} %description -n lib%{name}-devel This package contains the development files for the library lib%{name}, a @@ -103,7 +105,7 @@ Requires: %{name} = %{version}-%{release} Requires: iscsi-initiator-utils BuildRequires: iscsi-initiator-utils-devel Provides: storaged-iscsi = %{version}-%{release} -Obsoletes: storaged-iscsi +Obsoletes: storaged-iscsi < %{version}-%{release} %description iscsi This package contains module for iSCSI configuration. @@ -113,10 +115,10 @@ Summary: Module for LVM2 License: LGPLv2+ Requires: %{name} = %{version}-%{release} Requires: lvm2 -BuildRequires: lvm2-devel +Requires: libblockdev-lvm BuildRequires: libblockdev-lvm-devel Provides: storaged-lvm2 = %{version}-%{release} -Obsoletes: storaged-lvm2 +Obsoletes: storaged-lvm2 < %{version}-%{release} %description lvm2 This package contains module for LVM2 configuration. @@ -129,7 +131,7 @@ Requires: libstoragemgmt BuildRequires: libstoragemgmt-devel BuildRequires: libconfig-devel Provides: storaged-lsm = %{version}-%{release} -Obsoletes: storaged-lsm +Obsoletes: storaged-lsm < %{version}-%{release} %description lsm This package contains module for LSM configuration. @@ -182,6 +184,7 @@ fi %{_sysconfdir}/udisks2/mount_options.conf.example %{_datadir}/dbus-1/system.d/org.freedesktop.UDisks2.conf %{_datadir}/bash-completion/completions/udisksctl +%{_datadir}/zsh/site-functions/_udisks2 %{_tmpfilesdir}/%{name}.conf %{_unitdir}/udisks2.service %{_udevrulesdir}/80-udisks2.rules @@ -234,6 +237,14 @@ fi %attr(0600,root,root) %{_sysconfdir}/udisks2/modules.conf.d/udisks2_lsm.conf %changelog +* Mon Mar 24 2025 Xiaoping Liu - 2.10.90-1 +- update to 2.10.90 from 2.9.4 +- Remove the patch because the changes already exist upstream +- lvm2: Try opening for unused device detection harder +- mdraid: Avoid acquiring system inhibit lock for external array operations + [Patches cherry-pick from c10s. Original changelog: + - mdraid: Avoid acquiring system inhibit lock for external array operations. ( 2.10.90-5 )] + * Tue Feb 14 2023 Ziyang Zhang - 2.9.4-6 - Add latests patches fixing Fix GError ownership - Add missing libtool build requirement