summaryrefslogtreecommitdiffstats
path: root/src/dissect
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2023-01-17 18:50:59 +0100
committerLennart Poettering <lennart@poettering.net>2023-01-18 10:47:17 +0100
commit22ee78a8987f29e7f837efab86ed090ab78c1170 (patch)
treec2de760025b5f30bc7b27ecd48bfa423d1e3960d /src/dissect
parentdissect-image: add probe_sector_size() helper for detecting sector size of a ... (diff)
downloadsystemd-22ee78a8987f29e7f837efab86ed090ab78c1170.tar.xz
systemd-22ee78a8987f29e7f837efab86ed090ab78c1170.zip
loop-util: always tell kernel explicitly about loopback sector size
Let's not leave the sector size unspecified: either set a user supplied value, or auto-detect the right size by probing the disk image accordingly.
Diffstat (limited to 'src/dissect')
-rw-r--r--src/dissect/dissect.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/dissect/dissect.c b/src/dissect/dissect.c
index 25272c5e1b..df08cc2b74 100644
--- a/src/dissect/dissect.c
+++ b/src/dissect/dissect.c
@@ -1437,9 +1437,9 @@ static int run(int argc, char *argv[]) {
loop_flags = FLAGS_SET(arg_flags, DISSECT_IMAGE_NO_PARTITION_TABLE) ? 0 : LO_FLAGS_PARTSCAN;
if (arg_in_memory)
- r = loop_device_make_by_path_memory(arg_image, open_flags, loop_flags, LOCK_SH, &d);
+ r = loop_device_make_by_path_memory(arg_image, open_flags, /* sector_size= */ UINT32_MAX, loop_flags, LOCK_SH, &d);
else
- r = loop_device_make_by_path(arg_image, open_flags, loop_flags, LOCK_SH, &d);
+ r = loop_device_make_by_path(arg_image, open_flags, /* sector_size= */ UINT32_MAX, loop_flags, LOCK_SH, &d);
if (r < 0)
return log_error_errno(r, "Failed to set up loopback device for %s: %m", arg_image);