summaryrefslogtreecommitdiff
path: root/src/partition/growfs.c
diff options
context:
space:
mode:
authorundef <gitlab@undef.tools>2022-07-14 05:53:15 +0000
committerYu Watanabe <watanabe.yu+github@gmail.com>2022-07-14 21:23:11 +0900
commitd26c0f7243a709cfa7b8bdc87e8131746bb0e2d0 (patch)
treec67a488ad11f706dd4f00c40aecf54b8ffd7eecd /src/partition/growfs.c
parent8c776523348205ca22263138cbc612516987a9b8 (diff)
downloadsystemd-d26c0f7243a709cfa7b8bdc87e8131746bb0e2d0.tar.gz
growfs: don't actually resize on dry-run
This causes systemd-growfs to exit before resizing the partition when `--dry-run` is passed. Resizing during a dry run of a change breaks the users expectations.
Diffstat (limited to 'src/partition/growfs.c')
-rw-r--r--src/partition/growfs.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/partition/growfs.c b/src/partition/growfs.c
index 31dcf0ffdf..d9603d2b6d 100644
--- a/src/partition/growfs.c
+++ b/src/partition/growfs.c
@@ -241,6 +241,10 @@ static int run(int argc, char *argv[]) {
return log_error_errno(errno, "Failed to query size of \"%s\": %m", devpath);
log_debug("Resizing \"%s\" to %"PRIu64" bytes...", arg_target, size);
+
+ if (arg_dry_run)
+ return 0;
+
r = resize_fs(mountfd, size, &newsize);
if (r < 0)
return log_error_errno(r, "Failed to resize \"%s\" to %"PRIu64" bytes: %m",