Re: [vserver] [PATCH] soft limit bug fix

From: Herbert Poetzl <herbert_at_13thfloor.at>
Date: Thu 25 Oct 2007 - 11:11:41 BST
Message-ID: <20071025101141.GD624@MAIL.13thfloor.at>

On Thu, Oct 25, 2007 at 11:44:11AM +0900, Jun Kawashima wrote:
> 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.

thanks, nice catch, although I would prefer to adjust
the comment to match the reality than the other way
round ...

best,
Herbert

> 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 11:11:52 2007

[Next/Previous Months] [Main vserver Project Homepage] [Howto Subscribe/Unsubscribe] [Paul Sladen's vserver stuff]
Generated on Thu 25 Oct 2007 - 11:11:59 BST by hypermail 2.1.8