[lxc-devel] [lxd/master] lxd/storage/dir: Don't fail/complain about missing quotas

stgraber on Github lxc-bot at linuxcontainers.org
Sat Nov 2 18:51:19 UTC 2019


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 620 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20191102/e5917889/attachment.bin>
-------------- next part --------------
From b9803f69986a950fcbd1ad0159649fbdd0dd55de Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Sat, 2 Nov 2019 09:52:58 -0400
Subject: [PATCH] lxd/storage/dir: Don't fail/complain about missing quotas
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Every single call to "lxc info" hits GetVolumeUsage, leading to a lot of
warnings and errors being logged.

The only case where a log message is really appropriate is if the user
requests a quota be applied and we are unable to do so due to lack of
support.

Signed-off-by: Stéphane Graber <stgraber at ubuntu.com>
---
 lxd/storage/drivers/driver_dir.go | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/lxd/storage/drivers/driver_dir.go b/lxd/storage/drivers/driver_dir.go
index e4bfeb2779..61ed55a992 100644
--- a/lxd/storage/drivers/driver_dir.go
+++ b/lxd/storage/drivers/driver_dir.go
@@ -126,7 +126,7 @@ func (d *dir) GetVolumeUsage(volType VolumeType, volName string) (int64, error)
 	volPath := GetVolumeMountPath(d.name, volType, volName)
 	ok, err := quota.Supported(volPath)
 	if err != nil || !ok {
-		return -1, fmt.Errorf("The backing filesystem doesn't support quotas")
+		return 0, nil
 	}
 
 	// Get the volume ID for the volume to access quota.
@@ -695,7 +695,6 @@ func (d *dir) initQuota(path string, volID int64) error {
 	ok, err := quota.Supported(path)
 	if err != nil || !ok {
 		// Skipping quota as underlying filesystem doesn't suppport project quotas.
-		d.logger.Warn("The backing filesystem doesn't support quotas, skipping quota", log.Ctx{"path": path})
 		return nil
 	}
 


More information about the lxc-devel mailing list