summaryrefslogtreecommitdiffstats
path: root/src/shared/mkfs-util.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-09-16 18:18:34 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-09-16 18:18:34 +0000
commit67497cedb2f732b3445ecdc0d09b881f9c69f852 (patch)
treeb7197679acca419c7ddc0300873e19141d5fae3e /src/shared/mkfs-util.c
parentAdding debian version 256.1-2. (diff)
downloadsystemd-67497cedb2f732b3445ecdc0d09b881f9c69f852.tar.xz
systemd-67497cedb2f732b3445ecdc0d09b881f9c69f852.zip
Merging upstream version 256.2.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/shared/mkfs-util.c')
-rw-r--r--src/shared/mkfs-util.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/shared/mkfs-util.c b/src/shared/mkfs-util.c
index 4d44012..14bf82b 100644
--- a/src/shared/mkfs-util.c
+++ b/src/shared/mkfs-util.c
@@ -461,6 +461,15 @@ int make_filesystem(
if (quiet)
stdio_fds[1] = -EBADF;
+ if (sector_size > 0) {
+ if (strv_extend(&argv, "--sectorsize") < 0)
+ return log_oom();
+
+ /* mkfs.btrfs expects a sector size of at least 4k bytes. */
+ if (strv_extendf(&argv, "%"PRIu64, MAX(sector_size, 4 * U64_KB)) < 0)
+ return log_oom();
+ }
+
} else if (streq(fstype, "f2fs")) {
argv = strv_new(mkfs,
"-g", /* "default options" */