[lxc-devel] [lxd/master] lxd/storage/cephfs: Fix quota on new volumes

stgraber on Github lxc-bot at linuxcontainers.org
Tue Sep 22 17:31:19 UTC 2020


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 354 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20200922/bc2d6751/attachment.bin>
-------------- next part --------------
From bd1ea0d78544fd9bf75bebefea8a5149e74fea67 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Tue, 22 Sep 2020 13:31:00 -0400
Subject: [PATCH] lxd/storage/cephfs: Fix quota on new volumes
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: St├ęphane Graber <stgraber at ubuntu.com>
---
 lxd/storage/drivers/driver_cephfs_volumes.go | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/lxd/storage/drivers/driver_cephfs_volumes.go b/lxd/storage/drivers/driver_cephfs_volumes.go
index 40f3b6eb95..bdde9bfad1 100644
--- a/lxd/storage/drivers/driver_cephfs_volumes.go
+++ b/lxd/storage/drivers/driver_cephfs_volumes.go
@@ -44,6 +44,12 @@ func (d *cephfs) CreateVolume(vol Volume, filler *VolumeFiller, op *operations.O
 		}
 	}()
 
+	// Apply the volume quota if specified.
+	err = d.SetVolumeQuota(vol, vol.ExpandedConfig("size"), op)
+	if err != nil {
+		return err
+	}
+
 	// Fill the volume.
 	err = d.runFiller(vol, "", filler)
 	if err != nil {


More information about the lxc-devel mailing list