[vserver] [PATCH] soft limit bug fix

From: Jun Kawashima <junkawa_at_gmail.com>
Date: Thu 25 Oct 2007 - 03:44:11 BST
Message-ID: <9912ffd40710241944s68e9fe2ci76688558c1227605@mail.gmail.com>

Hi all,

I found a trivial bug about return value of soft limit in limit_int.h
and this is the patch.

Comment says the function __vx_cres_avail() return -1 when resource is
over soft limit, but it returns 1.

I'm using patch-2.6.22.9-vs2.2.0.4.diff.

Thanks.

---
diff -uprN linux-2.6.22.9.orig/include/linux/vserver/limit_int.h
linux-2.6.22.9/include/linux/vserver/limit_int.h
--- linux-2.6.22.9.orig/include/linux/vserver/limit_int.h	2007-10-25
10:53:18.000000000 +0900
+++ linux-2.6.22.9/include/linux/vserver/limit_int.h	2007-10-25
10:57:39.000000000 +0900
@@ -101,14 +101,14 @@ static inline int __vx_cres_avail(struct
 		return 1;
 	if (__rlim_soft(limit, res) == RLIM_INFINITY)
-		return -1;
+		return 1;
  	if (value + num <= __rlim_soft(limit, res))
-		return -1;
+		return 1;
 	if (__rlim_hard(limit, res) == RLIM_INFINITY)
-		return 1;
+		return -1;
  	if (value + num <= __rlim_hard(limit, res))
-		return 1;
+		return -1;
 	__rlim_hit(limit, res);
 	return 0;
---
Received on Thu Oct 25 03:44:22 2007
[Next/Previous Months] [Main vserver Project Homepage] [Howto Subscribe/Unsubscribe] [Paul Sladen's vserver stuff]
Generated on Thu 25 Oct 2007 - 03:44:28 BST by hypermail 2.1.8