lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Fri, 5 Jun 2009 13:20:31 -0700
From:	Andrew Morton <akpm@...ux-foundation.org>
To:	nishimura@....nes.nec.co.jp
Cc:	d-nishimura@....biglobe.ne.jp, linux-kernel@...r.kernel.org,
	linux-mm@...ck.org, lizf@...fujitsu.com, balbir@...ux.vnet.ibm.com,
	kamezawa.hiroyu@...fujitsu.com, menage@...gle.com
Subject: Re: [PATCH mmotm] memcg: add interface to reset limits

On Fri, 5 Jun 2009 22:22:45 +0900
Daisuke Nishimura <d-nishimura@....biglobe.ne.jp> wrote:

> We don't have interface to reset mem.limit or memsw.limit now.
> 
> This patch allows to reset mem.limit or memsw.limit when they are
> being set to -1.
> 
> ...
>
> @@ -133,6 +133,16 @@ int res_counter_memparse_write_strategy(const char *buf,
>  					unsigned long long *res)
>  {
>  	char *end;
> +
> +	/* return RESOURCE_MAX(unlimited) if "-1" is specified */
> +	if (*buf == '-') {
> +		*res = simple_strtoull(buf + 1, &end, 10);
> +		if (*res != 1 || *end != '\0')
> +			return -EINVAL;
> +		*res = RESOURCE_MAX;
> +		return 0;
> +	}

The test for (*end != '\0') would be unneeded if strict_strtoull() had
been used.


> +
>  	/* FIXME - make memparse() take const char* args */
>  	*res = memparse((char *)buf, &end);
>  	if (*end != '\0')
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists