[Devel] [PATCH 2/2] ve/fs: Print a message if a VE reaches its limit on mounts

Konstantin Khorenko khorenko at virtuozzo.com
Mon Jan 18 06:24:33 PST 2016


On 01/12/2016 04:11 PM, Evgenii Shatokhin wrote:
> https://jira.sw.ru/browse/PSBM-42825
>
> This patch is for vzkernel from beta3 (that is, 3.10.0-229.7.2.*).
>
> This should help debugging the situations when alloc_vfsmnt() fails.
>
> Rate-limiting is used to avoid the flood of such messages if the mount
> limit is hit often.
>
> Signed-off-by: Evgenii Shatokhin <eshatokhin at virtuozzo.com>
> ---
>   fs/namespace.c | 5 ++++-
>   1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/fs/namespace.c b/fs/namespace.c
> index fc8ea36..f4b7fcd 100644
> --- a/fs/namespace.c
> +++ b/fs/namespace.c
> @@ -167,8 +167,11 @@ static struct mount *alloc_vfsmnt(const char *name)
>   {
>   	struct mount *mnt;
>
> -	if (!ve_mount_allowed())
> +	if (!ve_mount_allowed()) {
> +		pr_warn_ratelimited("VE %p reached the limit on mounts.\n",
> +				    get_exec_env());

i suggest to use ve_name() here, pointer to ve_struct may be hard to understand postmortem.

>   		return NULL;
> +	}
>
>   	mnt = kmem_cache_zalloc(mnt_cache, GFP_KERNEL);
>   	if (mnt) {
>


More information about the Devel mailing list