mkfs-util: Don't set MKE2FS_DEVICE_PHYS_SECTSIZE

We only care about the logical sector size and if the physical sector
size isn't set and we're operating on a file, mke2fs will default the
physical sector size to the logical block size anyway.

This change makes sure that if we're operating on a block device and
set an explicit logical sector size, that doesn't affect the physical
sector size.
This commit is contained in:
Daan De Meyer
2023-08-15 12:10:14 +02:00
parent 5f13fb0a73
commit b1110c81d8
+5 -6
View File
@@ -432,14 +432,13 @@ int make_filesystem(
if (quiet && strv_extend(&argv, "-q") < 0)
return log_oom();
if (sector_size > 0)
FOREACH_STRING(s, "MKE2FS_DEVICE_SECTSIZE", "MKE2FS_DEVICE_PHYS_SECTSIZE") {
if (strv_extend(&env, s) < 0)
if (sector_size > 0) {
if (strv_extend(&env, "MKE2FS_DEVICE_SECTSIZE") < 0)
return log_oom();
if (strv_extendf(&env, "%"PRIu64, sector_size) < 0)
return log_oom();
}
if (strv_extendf(&env, "%"PRIu64, sector_size) < 0)
return log_oom();
}
} else if (streq(fstype, "btrfs")) {
argv = strv_new(mkfs,