[lxc-devel] [lxcfs/master] proc_fuse: silence error when we find no memlimit

Blub on Github lxc-bot at linuxcontainers.org
Fri Apr 24 07:23:25 UTC 2020


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 472 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20200424/04ce85f3/attachment-0001.bin>
-------------- next part --------------
From ee1a885f724747f40fe77c58ed36d8e752521692 Mon Sep 17 00:00:00 2001
From: Wolfgang Bumiller <w.bumiller at proxmox.com>
Date: Fri, 24 Apr 2020 09:17:06 +0200
Subject: [PATCH] proc_fuse: silence error when we find no memlimit

We get a positive result with an empty string if we do not
encounter any limits while walking up the cgroup.

Signed-off-by: Wolfgang Bumiller <w.bumiller at proxmox.com>
---
 src/proc_fuse.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/proc_fuse.c b/src/proc_fuse.c
index b2edf76..ae06bff 100644
--- a/src/proc_fuse.c
+++ b/src/proc_fuse.c
@@ -210,7 +210,7 @@ static uint64_t get_memlimit(const char *cgroup, bool swap)
 		ret = cgroup_ops->get_memory_swap_max(cgroup_ops, cgroup, &memlimit_str);
 	else
 		ret = cgroup_ops->get_memory_max(cgroup_ops, cgroup, &memlimit_str);
-	if (ret > 0 && safe_uint64(memlimit_str, &memlimit, 10) < 0)
+	if (ret > 0 && memlimit_str[0] && safe_uint64(memlimit_str, &memlimit, 10) < 0)
 		lxcfs_error("Failed to convert memlimit %s", memlimit_str);
 
 	return memlimit;


More information about the lxc-devel mailing list