From: Lennart Poettering Date: Mon, 24 Sep 2018 17:47:42 +0000 (+0200) Subject: btrfs: log at debug log when we ignore errors X-Git-Tag: v240~692^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F10164%2Fhead;p=thirdparty%2Fsystemd.git 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. --- diff --git a/src/shared/machine-pool.c b/src/shared/machine-pool.c index 4fedeb17e36..df56492e7b0 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;