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) {
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)
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)
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) {