Suggested in 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.

v.2: Print the name of the VE rather than its address.

Signed-off-by: Evgenii Shatokhin <[email protected]>
---
 fs/namespace.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/fs/namespace.c b/fs/namespace.c
index fc8ea36..6cfe52f 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(
+                       "VE \"%s\" reached the limit on mounts.\n",
+                       ve_name(get_exec_env()));
                return NULL;
+       }
 
        mnt = kmem_cache_zalloc(mnt_cache, GFP_KERNEL);
        if (mnt) {
-- 
2.6.3

_______________________________________________
Devel mailing list
[email protected]
https://lists.openvz.org/mailman/listinfo/devel

Reply via email to