If quota is not enabled on a btrfs file system, accept that, and only
log a debug message, but do not consider this a reason for failure.
Fixes: #1809
for (c = 0;; c++) {
if (ioctl(fd, BTRFS_IOC_QGROUP_CREATE, &args) < 0) {
+ /* If quota is not enabled, we get EINVAL. Turn this into a recognizable error */
+ if (errno == EINVAL)
+ return -ENOPROTOOPT;
+
if (errno == EBUSY && c < 10) {
(void) btrfs_quota_scan_wait(fd);
continue;
log_debug_errno(r, "Couldn't adjust quota for subvolume \"%s\" because of read-only file system: %m", i->path);
return 0;
}
+ if (r == -ENOPROTOOPT) {
+ log_debug_errno(r, "Couldn't adjust quota for subvolume \"%s\" because quota support is disabled: %m", i->path);
+ return 0;
+ }
if (r < 0)
return log_error_errno(r, "Failed to adjust quota for subvolume \"%s\": %m", i->path);
if (r > 0)