Your message dated Fri, 30 Apr 2021 21:42:26 +0200 with message-id <21245b24-2521-59bd-646b-035b94bb6028@debian.org> and subject line Re: Bug#987678: unblock: udisks2/2.9.2-2 has caused the Debian Bug report #987678, regarding unblock: udisks2/2.9.2-2 to be marked as done. This means that you claim that the problem has been dealt with. If this is not the case it is now your responsibility to reopen the Bug report if necessary, and/or fix the problem forthwith. (NB: If you are a system administrator and have no idea what this message is talking about, this may indicate a serious mail system misconfiguration somewhere. Please contact owner@bugs.debian.org immediately.) -- 987678: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=987678 Debian Bug Tracking System Contact owner@bugs.debian.org with problems
--- Begin Message ---
- To: Debian Bug Tracking System <submit@bugs.debian.org>
- Subject: unblock: udisks2/2.9.2-2
- From: Michael Biebl <biebl@debian.org>
- Date: Tue, 27 Apr 2021 18:41:42 +0200
- Message-id: <[🔎] 161954170264.5589.16981372745479521936.reportbug@pluto.milchstrasse.xx>
Package: release.debian.org Severity: normal User: release.debian.org@packages.debian.org Usertags: unblock X-Debbugs-Cc: pkg-utopia-maintainers@lists.alioth.debian.org Please unblock package udisks2 It fixes #987582: udisks_client_get_block_for_drive() always returns the wrong block of eMMC It's an upstream cherry-pick which ensure eMMC block devices are detected correctly. [ Tests ] No automated tests for this code, but the fix was confirmed by the original bug submitter. [ Risks ] udisks2 is a key package, but the change is rather small, see https://github.com/storaged-project/udisks/commit/5d0ac7ebefb8b7aad73871936f5011545cc66344 [ Checklist ] [x] all changes are documented in the d/changelog [x] I reviewed all changes and I approve them [x] attach debdiff against the package in testing [ Other info ] unblock udisks2/2.9.2-2diff --git a/debian/changelog b/debian/changelog index fabe2505..51c3b887 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +udisks2 (2.9.2-2) unstable; urgency=medium + + * udisksclient: Make get_block_for_drive deterministic. + Fixes "udisks_client_get_block_for_drive() always returns the wrong + block of eMMC". (Closes: #987582) + + -- Michael Biebl <biebl@debian.org> Mon, 26 Apr 2021 21:12:10 +0200 + udisks2 (2.9.2-1) unstable; urgency=medium * New upstream version 2.9.2 diff --git a/debian/patches/series b/debian/patches/series new file mode 100644 index 00000000..b5f3547a --- /dev/null +++ b/debian/patches/series @@ -0,0 +1 @@ +udisksclient-Make-get_block_for_drive-deterministic.patch diff --git a/debian/patches/udisksclient-Make-get_block_for_drive-deterministic.patch b/debian/patches/udisksclient-Make-get_block_for_drive-deterministic.patch new file mode 100644 index 00000000..e33737f0 --- /dev/null +++ b/debian/patches/udisksclient-Make-get_block_for_drive-deterministic.patch @@ -0,0 +1,71 @@ +From: Will Thompson <wjt@endlessos.org> +Date: Wed, 21 Apr 2021 10:56:30 +0100 +Subject: udisksclient: Make get_block_for_drive deterministic + +While any given Block object has at most one corresponding Drive, many +Block objects may share the same Drive. One example is eMMC devices +which provide a block device for the main data area (e.g. /dev/mmcblk0) +as well as additional logical block devices for device partitions (e.g. +/dev/mmcblk0boot0 and /dev/mmcblk0boot1). + +This behaviour was introduced in #834 to resolve issue #619 that these +device partitions caused a phantom additional Drive object to be +exposed. On that issue, I wrote: + +> I believe that Block.Drive on the boot partitions should point to the +> same data area as the main data area (and its logical partitions); +> udisks_client_get_block_for_drive() on the drive should return +> /org/freedesktop/UDisks2/block_devices/mmcblk0. + +The first part is now true, but as described on #879 the second part is +not true. It is now non-deterministic which Block will be returned, +based only on the order of objects returned by +g_dbus_object_manager_get_objects(). + +Make the return value of udisks_client_get_block_for_drive() +deterministic by sorting the list of candidate Block objects by their +device path in lexicographic order. Since (e.g.) /dev/mmcblk0 sorts +before /dev/mmcblk0boot0, this has the desirable side-effect that +calling udisks_client_get_block_for_drive() on an eMMC Drive returns the +'real' Block for the main data area. + +Fixes #879. + +(cherry picked from commit 5d0ac7ebefb8b7aad73871936f5011545cc66344) +--- + udisks/udisksclient.c | 15 +++++++++++++++ + 1 file changed, 15 insertions(+) + +diff --git a/udisks/udisksclient.c b/udisks/udisksclient.c +index 463b15a..1855209 100644 +--- a/udisks/udisksclient.c ++++ b/udisks/udisksclient.c +@@ -816,6 +816,20 @@ udisks_client_get_block_for_dev (UDisksClient *client, + + /* ---------------------------------------------------------------------------------------------------- */ + ++static int ++compare_blocks_by_device (gconstpointer a, ++ gconstpointer b) ++{ ++ UDisksBlock *block_a = udisks_object_get_block (UDISKS_OBJECT (a)); ++ UDisksBlock *block_b = udisks_object_get_block (UDISKS_OBJECT (b)); ++ ++ g_assert (block_a != NULL); ++ g_assert (block_b != NULL); ++ ++ return g_strcmp0 (udisks_block_get_device (block_a), ++ udisks_block_get_device (block_b)); ++} ++ + static GList * + get_top_level_blocks_for_drive (UDisksClient *client, + const gchar *drive_object_path) +@@ -847,6 +861,7 @@ get_top_level_blocks_for_drive (UDisksClient *client, + } + g_object_unref (block); + } ++ ret = g_list_sort (ret, compare_blocks_by_device); + g_list_free_full (object_proxies, g_object_unref); + return ret; + }
--- End Message ---
--- Begin Message ---
- To: Michael Biebl <biebl@debian.org>, 987678-done@bugs.debian.org
- Subject: Re: Bug#987678: unblock: udisks2/2.9.2-2
- From: Paul Gevers <elbrus@debian.org>
- Date: Fri, 30 Apr 2021 21:42:26 +0200
- Message-id: <21245b24-2521-59bd-646b-035b94bb6028@debian.org>
- In-reply-to: <[🔎] 161954170264.5589.16981372745479521936.reportbug@pluto.milchstrasse.xx>
- References: <[🔎] 161954170264.5589.16981372745479521936.reportbug@pluto.milchstrasse.xx>
Hi Michael, On 27-04-2021 18:41, Michael Biebl wrote: > Please unblock package udisks2 unblocked. PaulAttachment: OpenPGP_signature
Description: OpenPGP digital signature
--- End Message ---