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

Konstantin Khorenko khorenko at virtuozzo.com
Sat Jan 23 03:59:35 PST 2016


The commit is pushed to "branch-rh7-3.10.0-327.3.1-vz7.10.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-327.3.1.vz7.10.3
------>
commit a858babe75ddb0fb39698b4f2fc8e052fdab0073
Author: Evgenii Shatokhin <eshatokhin at virtuozzo.com>
Date:   Sat Jan 23 15:59:34 2016 +0400

    ve/fs: Print a message if a VE reaches its limit on mounts
    
    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.
    
    v2: Print the name of the VE rather than its address.
    
    Suggested in https://jira.sw.ru/browse/PSBM-42825
    
    Signed-off-by: Evgenii Shatokhin <eshatokhin at virtuozzo.com>
---
 fs/namespace.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/fs/namespace.c b/fs/namespace.c
index c66fa10..62a12b7 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -167,8 +167,12 @@ static struct mount *alloc_vfsmnt(const char *name)
 {
 	struct mount *mnt;
 
-	if (!ve_mount_allowed())
+	if (!ve_mount_allowed()) {
+		pr_warn_ratelimited(
+			"CT#%s reached the limit on mounts.\n",
+			ve_name(get_exec_env()));
 		return NULL;
+	}
 
 	mnt = kmem_cache_zalloc(mnt_cache, GFP_KERNEL);
 	if (mnt) {


More information about the Devel mailing list