]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
tmpfiles: don't consider it a problem if quota is not enabled on btrfs 1837/head
authorLennart Poettering <lennart@poettering.net>
Tue, 10 Nov 2015 20:39:52 +0000 (21:39 +0100)
committerLennart Poettering <lennart@poettering.net>
Tue, 10 Nov 2015 20:41:22 +0000 (21:41 +0100)
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
src/basic/btrfs-util.c
src/tmpfiles/tmpfiles.c

index 661331e8b24ed84f40e914798c7826790b23eeb0..290fabdeffef111a62ffd39aed13cec1fecbdad7 100644 (file)
@@ -1010,6 +1010,10 @@ static int qgroup_create_or_destroy(int fd, bool b, uint64_t qgroupid) {
         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;
index 64f0c9396c6268f2e9463c934376069382500a75..74b6b91593d7b9b2fdfa48b553162b4da344116a 100644 (file)
@@ -1267,6 +1267,10 @@ static int create_item(Item *i) {
                                 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)