summaryrefslogtreecommitdiff
path: root/src/import
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-02-24 18:43:37 +0100
committerLennart Poettering <lennart@poettering.net>2015-02-24 18:46:49 +0100
commit754061ce7173fd8cb66ade1a48381e2cead35522 (patch)
tree5db2ea3f26d7c19a82b3af2f725ba2900dc4a7cb /src/import
parent160e3793adf2da2bd9ae3fe6b8881bb937e6e71b (diff)
importd: enable btrfs quota in /var/lib/machines, if necessary
Diffstat (limited to 'src/import')
-rw-r--r--src/import/importd.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/import/importd.c b/src/import/importd.c
index 25d9ab2e71..f315212685 100644
--- a/src/import/importd.c
+++ b/src/import/importd.c
@@ -792,6 +792,11 @@ static int setup_machine_directory(sd_bus_error *error) {
return sd_bus_error_set_errnof(error, r, "Failed to determine whether /var/lib/machines is located on btrfs: %m");
if (r > 0) {
(void) btrfs_subvol_make_label("/var/lib/machines");
+
+ r = btrfs_quota_enable("/var/lib/machines", true);
+ if (r < 0)
+ log_warning_errno(r, "Failed to enable quota, ignoring: %m");
+
return 0;
}
@@ -858,6 +863,10 @@ static int setup_machine_directory(sd_bus_error *error) {
}
mntdir_mounted = true;
+ r = btrfs_quota_enable(mntdir, true);
+ if (r < 0)
+ log_warning_errno(r, "Failed to enable quota, ignoring: %m");
+
if (chmod(mntdir, 0700) < 0) {
r = sd_bus_error_set_errnof(error, errno, "Failed to fix owner: %m");
goto fail;