The following pull request was submitted through Github.
It can be accessed and reviewed at: https://github.com/lxc/lxd/pull/7032

This e-mail was sent by the LXC bot, direct replies will not reach the author
unless they happen to be subscribed to this list.

=== Description (from pull-request) ===
We shouldn't activate BTRFS quotas if not actually being used.

Fixes #7029

Signed-off-by: Thomas Parrott <thomas.parr...@canonical.com>
From 7b99d26e118625757cead61f984125b50cdf304b Mon Sep 17 00:00:00 2001
From: Thomas Parrott <thomas.parr...@canonical.com>
Date: Mon, 16 Mar 2020 14:36:26 +0000
Subject: [PATCH] lxd/storage/drivers/driver/btrfs/volumes: Dont activate
 quotas if not used

We shouldn't activate BTRFS quotas if not actually being used.

Fixes #7029

Signed-off-by: Thomas Parrott <thomas.parr...@canonical.com>
---
 lxd/storage/drivers/driver_btrfs_volumes.go | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/lxd/storage/drivers/driver_btrfs_volumes.go 
b/lxd/storage/drivers/driver_btrfs_volumes.go
index 202211cb30..ee8994b1fb 100644
--- a/lxd/storage/drivers/driver_btrfs_volumes.go
+++ b/lxd/storage/drivers/driver_btrfs_volumes.go
@@ -443,6 +443,11 @@ func (d *btrfs) SetVolumeQuota(vol Volume, size string, op 
*operations.Operation
        if err != nil && !d.state.OS.RunningInUserNS {
                // If quotas are disabled, attempt to enable them.
                if err == errBtrfsNoQuota {
+                       if sizeBytes <= 0 {
+                               // Nothing to do if the quota is being removed 
and we don't currently have quota.
+                               return nil
+                       }
+
                        path := GetPoolMountPath(d.name)
 
                        _, err = shared.RunCommand("btrfs", "quota", "enable", 
path)
_______________________________________________
lxc-devel mailing list
lxc-devel@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-devel

Reply via email to