diff --git a/src/import/import-fs.c b/src/import/import-fs.c index a36ab24fb8e..1fe5a257dbd 100644 --- a/src/import/import-fs.c +++ b/src/import/import-fs.c @@ -196,6 +196,7 @@ static int import_fs(int argc, char *argv[], void *userdata) { if (r < 0) goto finish; + (void) import_assign_pool_quota_and_warn(arg_image_root); (void) import_assign_pool_quota_and_warn(temp_path); if (arg_read_only) { diff --git a/src/import/import-tar.c b/src/import/import-tar.c index cc86bebb0e9..6baa2f43abf 100644 --- a/src/import/import-tar.c +++ b/src/import/import-tar.c @@ -222,8 +222,10 @@ static int tar_import_fork_tar(TarImport *i) { r = btrfs_subvol_make_fallback(i->temp_path, 0755); if (r < 0) return log_error_errno(r, "Failed to create directory/subvolume %s: %m", i->temp_path); - if (r > 0) /* actually btrfs subvol */ + if (r > 0) { /* actually btrfs subvol */ + (void) import_assign_pool_quota_and_warn(i->image_root); (void) import_assign_pool_quota_and_warn(i->temp_path); + } i->tar_fd = import_fork_tar_x(i->temp_path, &i->tar_pid); if (i->tar_fd < 0) diff --git a/src/import/pull-tar.c b/src/import/pull-tar.c index b52569d20c5..90f439f998d 100644 --- a/src/import/pull-tar.c +++ b/src/import/pull-tar.c @@ -424,8 +424,10 @@ static int tar_pull_job_on_open_disk_tar(PullJob *j) { r = btrfs_subvol_make_fallback(i->temp_path, 0755); if (r < 0) return log_error_errno(r, "Failed to create directory/subvolume %s: %m", i->temp_path); - if (r > 0) /* actually btrfs subvol */ + if (r > 0) { /* actually btrfs subvol */ + (void) import_assign_pool_quota_and_warn(i->image_root); (void) import_assign_pool_quota_and_warn(i->temp_path); + } j->disk_fd = import_fork_tar_x(i->temp_path, &i->tar_pid); if (j->disk_fd < 0) diff --git a/src/shared/import-util.c b/src/shared/import-util.c index 298c066dffd..2a30e40686f 100644 --- a/src/shared/import-util.c +++ b/src/shared/import-util.c @@ -143,15 +143,7 @@ int raw_strip_suffixes(const char *p, char **ret) { int import_assign_pool_quota_and_warn(const char *path) { int r; - r = btrfs_subvol_auto_qgroup("/var/lib/machines", 0, true); - if (r == -ENOTTY) { - log_debug_errno(r, "Failed to set up default quota hierarchy for /var/lib/machines, as directory is not on btrfs or not a subvolume. Ignoring."); - return 0; - } - if (r < 0) - return log_error_errno(r, "Failed to set up default quota hierarchy for /var/lib/machines: %m"); - if (r > 0) - log_info("Set up default quota hierarchy for /var/lib/machines."); + assert(path); r = btrfs_subvol_auto_qgroup(path, 0, true); if (r == -ENOTTY) {