From: Daan De Meyer Date: Tue, 23 Jul 2024 20:44:03 +0000 (+0200) Subject: repart: Create disk image file with copy-on-write disabled on btrfs X-Git-Tag: v257-rc1~817^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4dee4e00392e64f6c4f84c1e8fee335b7dbf590c;p=thirdparty%2Fsystemd.git repart: Create disk image file with copy-on-write disabled on btrfs COW on btrfs generally does not play well lots of random writes so let's make the disk images generated by repart NOCOW by default on btrfs like we do elsewhere across the codebase. --- diff --git a/src/partition/repart.c b/src/partition/repart.c index 118a369206d..7db493cafc3 100644 --- a/src/partition/repart.c +++ b/src/partition/repart.c @@ -7909,7 +7909,7 @@ static int find_root(Context *context) { if (!s) return log_oom(); - fd = open(arg_node, O_RDONLY|O_CREAT|O_EXCL|O_CLOEXEC|O_NOFOLLOW, 0666); + fd = xopenat_full(AT_FDCWD, arg_node, O_RDONLY|O_CREAT|O_EXCL|O_CLOEXEC|O_NOFOLLOW, XO_NOCOW, 0666); if (fd < 0) return log_error_errno(errno, "Failed to create '%s': %m", arg_node);