Daan De Meyer and Luca Boccassi
3978b076af
loop-util: shortcut block device fd when it carries no partition table
...
663f0bf5cb stopped reusing the original block device fd whenever
partition scanning was requested (LO_FLAGS_PARTSCAN) but couldn't be
enabled on the device, so that nested partition tables on devices the
kernel won't scan (e.g. the pmOS/android case) get exposed via a real
loop device.
However that also forced a pointless loop device for any partition that
carries a file system directly, e.g. a btrfs subvolume mounted via
MountImages=. For multi-device btrfs this is fatal: the kernel rejects
seeing the same member via both the original partition and the loop
device, and the mount fails.
A loop device is only ever needed here to expose a nested partition
table. So only refuse the shortcut when the device actually carries one,
probed via gpt_probe(), instead of whenever partition scanning is
disabled. Devices carrying a file system directly (or nothing) take the
shortcut as before.
Add an integration test to cover the failure scenario of the original
issue.
Fixes: https://github.com/systemd/systemd/issues/42520
Replaces: https://github.com/systemd/systemd/pull/42576
Follow-up for 663f0bf5cb79ecaf6dd71441ecdc9dc401e7eae6
Co-Authored-By: Luca Boccassi <luca.boccassi@gmail.com >
Co-developed-by: Claude Opus 4.8 <noreply@anthropic.com >
2026-06-16 00:16:05 +01:00
..
2025-12-07 09:09:03 +09:00
2025-11-04 15:53:23 +00:00
2025-07-13 05:49:00 +09:00
2026-04-02 18:08:25 +02:00
2025-12-07 09:09:03 +09:00
2026-04-20 09:37:13 +02:00
2025-12-10 12:09:10 +01:00
2025-11-07 21:35:45 +00:00
2025-08-01 05:42:51 +09:00
2025-07-10 13:37:07 +09:00
2026-06-07 21:49:43 +02:00
2026-01-30 09:30:20 -05:00
2026-05-08 12:01:06 +01:00
2025-07-28 16:29:31 +09:00
2026-05-04 14:30:03 +01:00
2026-04-09 22:39:11 +02:00
2026-05-05 10:45:04 +02:00
2026-05-12 23:38:52 +01:00
2026-04-02 22:58:19 +09:00
2026-02-22 15:13:02 +01:00
2025-04-25 06:13:43 +09:00
2026-05-05 10:37:13 +02:00
2026-02-19 15:08:20 +01:00
2026-04-14 20:35:24 +02:00
2025-09-23 15:48:53 +01:00
2025-12-07 09:09:03 +09:00
2025-12-07 09:09:03 +09:00
2025-12-18 00:19:09 +01:00
2025-12-07 09:09:03 +09:00
2025-12-07 09:09:03 +09:00
2025-12-07 09:09:03 +09:00
2025-11-17 16:50:50 +01:00
2025-11-17 16:50:50 +01:00
2025-07-24 16:35:45 +02:00
2026-03-11 18:09:27 +01:00
2025-09-23 15:48:53 +01:00
2025-09-04 10:58:33 +09:00
2025-06-21 02:22:28 +09:00
2025-11-17 16:50:50 +01:00
2026-06-05 04:56:34 +09:00
2025-09-26 07:20:04 +09:00
2025-07-24 20:55:10 +09:00
2025-12-10 12:09:10 +01:00
2025-09-23 15:48:53 +01:00
2025-12-09 14:41:59 +09:00
2026-01-23 19:29:48 +01:00
2025-12-07 09:09:03 +09:00
2025-07-03 19:35:33 +02:00
2025-09-26 07:20:04 +09:00
2026-05-05 11:53:01 +01:00
2026-05-11 10:59:00 +02:00
2026-05-19 22:53:59 +01:00
2025-10-28 13:26:15 +00:00
2025-05-16 22:24:54 +09:00
2026-04-14 20:35:24 +02:00
2026-01-06 03:26:15 -08:00
2025-12-07 09:09:03 +09:00
2025-09-23 15:48:53 +01:00
2026-06-05 04:39:00 +09:00
2026-05-21 18:06:07 +02:00
2025-12-10 12:09:10 +01:00
2025-09-26 07:20:04 +09:00
2026-05-16 15:59:15 +02:00
2026-04-14 20:35:24 +02:00
2026-06-05 04:56:34 +09:00
2025-12-07 09:10:29 +09:00
2026-06-05 04:56:34 +09:00
2025-03-28 10:34:02 +00:00
2026-05-21 10:14:08 +01:00
2026-01-18 14:14:24 +09:00
2025-12-07 09:09:03 +09:00
2025-04-05 17:33:31 +09:00
2025-11-17 16:50:50 +01:00
2026-01-14 16:32:38 +01:00
2026-02-15 12:51:00 +00:00
2026-01-14 16:32:38 +01:00
2026-02-15 12:51:00 +00:00
2025-04-12 05:08:20 +09:00
2025-12-10 12:09:10 +01:00
2026-05-20 11:39:11 +02:00
2026-01-14 16:32:38 +01:00
2026-01-14 16:32:38 +01:00
2026-01-14 16:32:38 +01:00
2026-01-14 16:32:38 +01:00
2025-04-05 17:33:31 +09:00
2026-01-14 16:32:38 +01:00
2026-05-28 02:08:24 +09:00
2026-02-06 18:19:33 +01:00
2025-04-05 17:33:31 +09:00
2025-04-05 17:33:31 +09:00
2025-04-03 10:28:25 +09:00
2025-12-10 12:09:10 +01:00
2025-12-10 12:09:10 +01:00
2026-02-11 11:24:37 +01:00
2026-01-14 16:32:38 +01:00
2025-09-26 09:28:12 +09:00
2025-09-26 07:20:04 +09:00
2025-09-23 15:48:53 +01:00
2026-03-11 03:36:21 +09:00
2025-09-05 08:29:52 +02:00
2026-03-18 14:58:43 +01:00
2025-11-17 16:50:50 +01:00
2025-09-23 15:48:53 +01:00
2025-09-23 15:48:53 +01:00
2025-09-23 15:48:53 +01:00
2025-09-23 15:48:53 +01:00
2025-09-23 15:48:53 +01:00
2025-09-23 15:48:53 +01:00
2025-12-10 12:09:10 +01:00
2025-09-23 15:48:53 +01:00
2025-09-23 15:48:53 +01:00
2025-09-23 15:48:53 +01:00
2025-09-23 15:48:53 +01:00
2025-09-23 15:48:53 +01:00
2025-09-23 15:48:53 +01:00
2025-09-23 15:48:53 +01:00
2026-05-09 11:36:55 +02:00
2025-09-26 07:20:04 +09:00
2025-09-26 07:20:04 +09:00
2025-12-07 09:09:03 +09:00
2025-11-17 16:50:50 +01:00
2025-09-26 07:20:04 +09:00
2025-09-26 07:20:04 +09:00
2025-09-26 07:20:04 +09:00
2025-12-07 09:09:03 +09:00
2025-05-29 05:41:29 +09:00
2025-12-07 09:09:03 +09:00
2025-09-26 07:20:04 +09:00
2025-09-26 07:20:04 +09:00
2025-09-26 07:20:04 +09:00
2026-01-16 22:56:28 +09:00
2026-05-22 14:09:16 +01:00
2026-05-20 16:11:45 +02:00
2026-02-12 23:20:47 +00:00
2026-03-03 09:38:36 +01:00
2026-01-14 16:32:38 +01:00
2026-01-21 15:09:46 +01:00
2025-09-26 07:20:04 +09:00
2025-09-26 07:20:04 +09:00
2025-12-07 09:09:03 +09:00
2026-05-22 02:56:24 +00:00
2026-05-05 17:22:26 +02:00
2025-09-26 07:20:04 +09:00
2025-12-10 12:09:10 +01:00
2025-09-26 07:20:04 +09:00
2025-09-02 09:38:51 +01:00
2026-06-05 07:23:34 +09:00
2025-09-23 15:48:53 +01:00
2026-06-16 00:16:05 +01:00
2025-12-18 09:12:54 +01:00
2026-06-05 04:56:34 +09:00
2026-06-16 00:16:05 +01:00
2026-02-04 00:05:24 +01:00
2025-09-26 07:20:04 +09:00
2026-01-30 09:30:20 -05:00
2026-05-05 17:22:26 +02:00
2026-01-30 09:30:20 -05:00
2026-05-11 10:57:46 +02:00
2025-09-24 09:52:36 +02:00
2026-06-04 14:44:55 +01:00
2026-05-26 21:49:10 +01:00
2026-06-05 07:23:34 +09:00
2025-12-10 12:09:10 +01:00
2026-06-01 11:48:19 +02:00
2025-12-10 12:09:10 +01:00
2025-11-17 16:50:50 +01:00
2026-05-26 15:09:01 +01:00
2026-06-01 18:24:15 +01:00
2025-09-26 07:20:04 +09:00
2026-05-11 14:37:08 +01:00
2025-09-26 07:20:04 +09:00
2026-05-18 02:44:46 +09:00
2026-05-03 18:08:33 +01:00
2026-05-03 18:08:33 +01:00
2026-05-05 11:10:25 +02:00
2026-05-03 18:08:33 +01:00
2026-05-22 12:15:15 +02:00
2026-05-03 18:08:33 +01:00
2026-05-03 18:08:33 +01:00
2025-12-16 21:10:12 +00:00
2026-03-18 20:47:00 +00:00
2026-06-15 06:59:24 +09:00
2025-06-23 15:32:11 +02:00
2026-06-13 09:39:28 +01:00
2026-06-03 14:02:44 +01:00
2026-04-04 18:18:30 +01:00
2025-09-23 15:48:53 +01:00
2025-12-10 12:09:10 +01:00
2026-03-26 16:13:11 +01:00
2025-12-18 13:57:32 +01:00
2026-05-21 18:30:16 +02:00
2025-09-26 09:42:13 +02:00
2025-11-17 16:50:50 +01:00
2025-07-23 22:11:42 +09:00
2026-04-20 15:01:17 +01:00
2025-09-23 15:48:53 +01:00
2026-05-22 12:17:09 +02:00
2025-11-05 02:53:05 +09:00
2025-10-23 11:56:26 +01:00
2026-03-20 09:37:24 +01:00
2025-10-04 23:00:31 +02:00
2026-06-05 04:56:34 +09:00
2026-06-05 04:56:34 +09:00
2026-05-19 11:05:55 +02:00
2026-05-19 11:05:55 +02:00
2026-05-19 11:05:55 +02:00
2026-05-25 17:33:16 +01:00
2026-06-05 04:56:34 +09:00
2025-09-23 15:48:53 +01:00
2026-05-25 12:37:36 +02:00
2025-09-26 07:20:04 +09:00
2026-04-09 22:47:10 +02:00
2025-12-10 12:09:10 +01:00
2025-09-18 20:22:42 +02:00
2025-07-23 08:35:51 +09:00
2025-09-23 15:48:53 +01:00
2026-05-21 16:02:43 +01:00
2025-05-29 01:15:56 +01:00
2026-05-03 18:08:33 +01:00
2026-05-06 10:30:17 +02:00
2026-05-22 12:26:25 +02:00
2026-05-19 08:28:53 +00:00
2025-11-07 14:12:56 +01:00
2026-02-06 18:19:33 +01:00
2026-05-05 17:22:26 +02:00
2026-05-12 22:54:07 +02:00
2025-09-04 02:05:09 +09:00
2026-04-29 12:26:52 +02:00
2025-10-06 04:55:25 +09:00
2026-05-05 15:09:47 +02:00
2025-12-10 12:09:10 +01:00
2026-04-15 10:14:48 +02:00
2026-05-25 12:58:04 +01:00
2026-03-12 13:40:05 +00:00
2026-02-23 02:55:38 +01:00
2026-05-13 10:36:12 +02:00
2026-05-13 10:36:12 +02:00
2026-05-13 10:36:12 +02:00
2026-05-13 10:36:12 +02:00
2026-05-22 12:00:05 +01:00
2026-04-15 10:14:48 +02:00