summaryrefslogtreecommitdiff
path: root/app-containers/lxd/files/lxd-5.0.2-fix-btrfs-driver-to-support-btrfs-6.0.patch
diff options
context:
space:
mode:
Diffstat (limited to 'app-containers/lxd/files/lxd-5.0.2-fix-btrfs-driver-to-support-btrfs-6.0.patch')
-rw-r--r--app-containers/lxd/files/lxd-5.0.2-fix-btrfs-driver-to-support-btrfs-6.0.patch27
1 files changed, 27 insertions, 0 deletions
diff --git a/app-containers/lxd/files/lxd-5.0.2-fix-btrfs-driver-to-support-btrfs-6.0.patch b/app-containers/lxd/files/lxd-5.0.2-fix-btrfs-driver-to-support-btrfs-6.0.patch
new file mode 100644
index 000000000000..c6cf6c97b013
--- /dev/null
+++ b/app-containers/lxd/files/lxd-5.0.2-fix-btrfs-driver-to-support-btrfs-6.0.patch
@@ -0,0 +1,27 @@
+From 37779fd75dbcd02fab03a8327a1ec7a6f3273371 Mon Sep 17 00:00:00 2001
+From: Thomas Parrott <thomas.parrott@canonical.com>
+Date: Wed, 4 Jan 2023 09:59:37 +0000
+Subject: [PATCH] lxd/storage/drivers/driver/btrfs/utils: Fix getQGroup to
+ suport BTRFS >= 6.0.1
+
+Fixes #11210
+
+Signed-off-by: Thomas Parrott <thomas.parrott@canonical.com>
+---
+ lxd/storage/drivers/driver_btrfs_utils.go | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/lxd/storage/drivers/driver_btrfs_utils.go b/lxd/storage/drivers/driver_btrfs_utils.go
+index 8f0846d2fc9f..e1468e4b1a59 100644
+--- a/lxd/storage/drivers/driver_btrfs_utils.go
++++ b/lxd/storage/drivers/driver_btrfs_utils.go
+@@ -247,7 +247,8 @@ func (d *btrfs) getQGroup(path string) (string, int64, error) {
+ var qgroup string
+ usage := int64(-1)
+ for _, line := range strings.Split(output, "\n") {
+- if line == "" || strings.HasPrefix(line, "qgroupid") || strings.HasPrefix(line, "---") {
++ // Use case-insensitive field title match because BTRFS tooling changed casing between versions.
++ if line == "" || strings.HasPrefix(strings.ToLower(line), "qgroupid") || strings.HasPrefix(line, "-") {
+ continue
+ }
+