[Devel] [PATCH RHEL7 COMMIT] ve/fs: namespace -- Don't fail on permissions if @ve->devmnt_list is empty

Konstantin Khorenko khorenko at virtuozzo.com
Fri Jun 24 03:26:56 PDT 2016


The commit is pushed to "branch-rh7-3.10.0-327.18.2.vz7.14.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-327.18.2.vz7.14.19
------>
commit b24d0d2aae02d1eeb033518dc2060c9e93c386d3
Author: Cyrill Gorcunov <gorcunov at virtuozzo.com>
Date:   Fri Jun 24 14:26:56 2016 +0400

    ve/fs: namespace -- Don't fail on permissions if @ve->devmnt_list is empty
    
    In commit 7eeb5b4afa8db5a2f2e1e47ab6b84e55fc8c5661 I addressed
    first half of a problem, but I happen to work with dirty copy
    of libvzctl where mount_opts cgroup has been c/r'ed manually,
    so I missed the case where @devmnt_list is empty on restore
    (just like it is in vanilla libvzctl). So fix the second half.
    
    https://jira.sw.ru/browse/PSBM-48188
    
    Reported-by: Igor Sukhih <igor at virtuozzo.com>
    Signed-off-by: Cyrill Gorcunov <gorcunov at virtuozzo.com>
    Reviewed-by: Vladimir Davydov <vdavydov at virtuozzo.com>
    
    CC: Konstantin Khorenko <khorenko at virtuozzo.com>
---
 fs/namespace.c | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)

diff --git a/fs/namespace.c b/fs/namespace.c
index 3df0ac5..66e892c 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -1954,10 +1954,20 @@ again:
 		goto again;
 	case 1:
 		if (*data_pp) {
-			ve_printk(VE_LOG_BOTH, KERN_WARNING "VE%s: no allowed "
-				  "mount options found for device %u:%u\n",
-				  ve->ve_name, MAJOR(dev), MINOR(dev));
-			err = -EPERM;
+			/*
+			 * Same as in chunk above but for case where
+			 * ve->devmnt_list is empty. Depending on
+			 * the way userspace tool restore container
+			 * it might be nonempty as well.
+			 */
+			if (ve->is_pseudosuper) {
+				err = 0;
+			} else {
+				ve_printk(VE_LOG_BOTH, KERN_WARNING "VE%s: no allowed "
+					  "mount options found for device %u:%u\n",
+					  ve->ve_name, MAJOR(dev), MINOR(dev));
+				err = -EPERM;
+			}
 		} else
 			err = 0;
 		break;


More information about the Devel mailing list