[lxc-devel] [lxd/master] btrfs: Enable quotas on the pools we create

stgraber on Github lxc-bot at linuxcontainers.org
Mon Feb 20 00:47:20 UTC 2017


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/20170220/63e13420/attachment.bin>
-------------- next part --------------
From 5875511f1c649818f255681b93a26bbe916a7853 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Sun, 19 Feb 2017 19:46:52 -0500
Subject: [PATCH] btrfs: Enable quotas on the pools we create
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_btrfs.go | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/lxd/storage_btrfs.go b/lxd/storage_btrfs.go
index 894be07..138e171 100644
--- a/lxd/storage_btrfs.go
+++ b/lxd/storage_btrfs.go
@@ -180,6 +180,13 @@ func (s *storageBtrfs) StoragePoolCreate() error {
 		return fmt.Errorf("Failed to create the BTRFS pool: %s", output)
 	}
 
+	// Enable quotas
+	output, err := exec.Command(
+		"btrfs", "quota", "enable", source).CombinedOutput()
+	if err != nil {
+		return fmt.Errorf("Failed to enable quotas on BTRFS pool: %s", output)
+	}
+
 	var err1 error
 	var devUUID string
 	if isBlockDev && filepath.IsAbs(source) {


More information about the lxc-devel mailing list