[lxc-devel] [lxd/master] Storage fixes

stgraber on Github lxc-bot at linuxcontainers.org
Sat Jun 22 04:25:23 UTC 2019


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 361 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20190621/37918208/attachment.bin>
-------------- next part --------------
From 76b7db6e38ee3dbc114ded2ce8d5170e7e4cd5dc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Fri, 21 Jun 2019 19:10:05 -0400
Subject: [PATCH 1/2] lxd/storage/dir: Fix quotas on dir
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_dir.go | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/lxd/storage_dir.go b/lxd/storage_dir.go
index 9763f6395d..818ad9e479 100644
--- a/lxd/storage_dir.go
+++ b/lxd/storage_dir.go
@@ -448,6 +448,24 @@ func (s *storageDir) StoragePoolVolumeUpdate(writable *api.StorageVolumePut, cha
 		return updateStoragePoolVolumeError(unchangeable, "dir")
 	}
 
+	if shared.StringInSlice("size", changedConfig) {
+		if s.volume.Type != storagePoolVolumeTypeNameCustom {
+			return updateStoragePoolVolumeError([]string{"size"}, "dir")
+		}
+
+		if s.volume.Config["size"] != writable.Config["size"] {
+			size, err := shared.ParseByteSizeString(writable.Config["size"])
+			if err != nil {
+				return err
+			}
+
+			err = s.StorageEntitySetQuota(storagePoolVolumeTypeCustom, size, nil)
+			if err != nil {
+				return err
+			}
+		}
+	}
+
 	logger.Infof(`Updated DIR storage volume "%s"`, s.volume.Name)
 	return nil
 }

From e244b6eba7d0e9c7ecaafdacba4556e06ae65a72 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Fri, 21 Jun 2019 23:09:30 -0400
Subject: [PATCH 2/2] lxd/rsync: Filter out ceph xattrs
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/rsync.go | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lxd/rsync.go b/lxd/rsync.go
index e4af344557..87f2ccaa94 100644
--- a/lxd/rsync.go
+++ b/lxd/rsync.go
@@ -42,6 +42,8 @@ func rsyncLocalCopy(source string, dest string, bwlimit string) (string, error)
 		"--checksum",
 		"--numeric-ids",
 		"--xattrs",
+		"--filter=-x system.*",
+		"--filter=-x ceph.*",
 		"--bwlimit", bwlimit,
 		rsyncVerbosity,
 		shared.AddSlash(source),
@@ -280,6 +282,8 @@ func rsyncFeatureArgs(features []string) []string {
 	args := []string{}
 	if shared.StringInSlice("xattrs", features) {
 		args = append(args, "--xattrs")
+		args = append(args, "--filter=-x system.*")
+		args = append(args, "--filter=-x ceph.*")
 	}
 
 	if shared.StringInSlice("delete", features) {


More information about the lxc-devel mailing list