[Devel] [RFC 14/54] generic: fix CONFIG_VE=n build
Eva Kurchatova
eva.kurchatova at virtuozzo.com
Wed Apr 29 22:58:14 MSK 2026
Signed-off-by: Eva Kurchatova <eva.kurchatova at virtuozzo.com>
---
fs/proc/generic.c | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/fs/proc/generic.c b/fs/proc/generic.c
index eefe65d93a70..8e237be9b8f0 100644
--- a/fs/proc/generic.c
+++ b/fs/proc/generic.c
@@ -115,10 +115,12 @@ static bool pde_subdir_insert(struct proc_dir_entry *dir,
return true;
}
+#ifdef CONFIG_VE
static bool proc_in_container(struct super_block *sb)
{
return !ve_is_super(get_exec_env());
}
+#endif
static int proc_notify_change(struct mnt_idmap *idmap,
struct dentry *dentry, struct iattr *iattr)
@@ -126,11 +128,11 @@ static int proc_notify_change(struct mnt_idmap *idmap,
struct inode *inode = d_inode(dentry);
struct proc_dir_entry *de = PDE(inode);
int error;
-
+#ifdef CONFIG_VE
if (proc_in_container(dentry->d_sb) &&
(iattr->ia_valid & (ATTR_MODE|ATTR_UID|ATTR_GID)))
return -EPERM;
-
+#endif
error = setattr_prepare(&nop_mnt_idmap, dentry, iattr);
if (error)
return error;
@@ -259,7 +261,11 @@ struct dentry *proc_lookup_de(struct inode *dir, struct dentry *dentry,
struct proc_dir_entry *de)
{
struct inode *inode;
+#ifdef CONFIG_VE
bool in_container = proc_in_container(dentry->d_sb);
+#else
+ bool in_container = false;
+#endif
read_lock(&proc_subdir_lock);
de = pde_subdir_find(de, dentry->d_name.name, dentry->d_name.len);
@@ -304,7 +310,11 @@ int proc_readdir_de(struct file *file, struct dir_context *ctx,
struct proc_dir_entry *de)
{
int i;
+#ifdef CONFIG_VE
bool in_container = proc_in_container(file->f_path.dentry->d_sb);
+#else
+ bool in_container = false;
+#endif
if (!dir_emit_dots(file, ctx))
return 0;
--
2.54.0
More information about the Devel
mailing list