summaryrefslogtreecommitdiff
path: root/src/shared/machine-pool.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2018-09-24 19:47:42 +0200
committerLennart Poettering <lennart@poettering.net>2018-09-24 19:47:42 +0200
commit7e6912787106a0354f199d620959982f090dd14b (patch)
tree559da89ce876609f1bde5c9a0c0736220bdfc33f /src/shared/machine-pool.c
parentde89949a71bee17e4b432ac5928376b8347892c4 (diff)
downloadsystemd-7e6912787106a0354f199d620959982f090dd14b.tar.gz
btrfs: log at debug log when we ignore errors
This stuff is likely to fail in many setups (for example when quota is not supported by the btrfs version), hence only log at debug level. Previously we'd silently ignore things altogether which makes things pretty hard to debug.
Diffstat (limited to 'src/shared/machine-pool.c')
-rw-r--r--src/shared/machine-pool.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/shared/machine-pool.c b/src/shared/machine-pool.c
index 4fedeb17e3..df56492e7b 100644
--- a/src/shared/machine-pool.c
+++ b/src/shared/machine-pool.c
@@ -378,14 +378,21 @@ int grow_machine_directory(void) {
new_size = old_size + max_add;
r = btrfs_resize_loopback("/var/lib/machines", new_size, true);
- if (r <= 0)
- return r;
+ if (r < 0)
+ return log_debug_errno(r, "Failed to resize loopback: %m");
+ if (r == 0)
+ return 0;
/* Also bump the quota, of both the subvolume leaf qgroup, as
* well as of any subtree quota group by the same id but a
* higher level, if it exists. */
- (void) btrfs_qgroup_set_limit("/var/lib/machines", 0, new_size);
- (void) btrfs_subvol_set_subtree_quota_limit("/var/lib/machines", 0, new_size);
+ r = btrfs_qgroup_set_limit("/var/lib/machines", 0, new_size);
+ if (r < 0)
+ log_debug_errno(r, "Failed to set btrfs limit: %m");
+
+ r = btrfs_subvol_set_subtree_quota_limit("/var/lib/machines", 0, new_size);
+ if (r < 0)
+ log_debug_errno(r, "Failed to set btrfs subtree limit: %m");
log_info("Grew /var/lib/machines btrfs loopback file system to %s.", format_bytes(buf, sizeof(buf), new_size));
return 1;