加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
backport-growfs-don-t-actually-resize-on-dry-run.patch 1.34 KB
一键复制 编辑 原始数据 按行查看 历史
From e9a1f6237f281b4bf05386bd9b2c921ea999232f Mon Sep 17 00:00:00 2001
From: undef <gitlab@undef.tools>
Date: Thu, 14 Jul 2022 05:53:15 +0000
Subject: [PATCH] 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.
(cherry picked from commit d26c0f7243a709cfa7b8bdc87e8131746bb0e2d0)
(cherry picked from commit 00c6c62845c560ef09f845aeedabdc9027be5678)
(cherry picked from commit e39019fd1065c8e2eb078b72359c5e755b013493)
Conflict:NA
Reference:https://github.com/systemd/systemd/commit/e9a1f6237f281b4bf05386bd9b2c921ea999232f
---
src/partition/growfs.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/partition/growfs.c b/src/partition/growfs.c
index 15c56d0584..a7e745208b 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",
--
2.27.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化