[RHEL7,COMMIT] Revert "ve/sysfs: allow symlinks between tagged and generic directories"

Submitted by Konstantin Khorenko on Dec. 27, 2017, 3:54 p.m.

Details

Message ID 201712271554.vBRFsAsZ013647@finist_ce7.work
State New
Headers show

Patch hide | download patch | download mbox

diff --git a/fs/sysfs/dir.c b/fs/sysfs/dir.c
index 9d307fa4cb10..dd34b5932ce6 100644
--- a/fs/sysfs/dir.c
+++ b/fs/sysfs/dir.c
@@ -468,14 +468,14 @@  int __sysfs_add_one(struct sysfs_addrm_cxt *acxt, struct sysfs_dirent *sd)
 {
 	struct sysfs_inode_attrs *ps_iattr;
 	int ret;
-#ifndef CONFIG_VE
+
 	if (!!sysfs_ns_type(acxt->parent_sd) != !!sd->s_ns) {
 		WARN(1, KERN_WARNING "sysfs: ns %s in '%s' for '%s'\n",
 			sysfs_ns_type(acxt->parent_sd)? "required": "invalid",
 			acxt->parent_sd->s_name, sd->s_name);
 		return -EINVAL;
 	}
-#endif
+
 	sd->s_hash = sysfs_name_hash(sd->s_ns, sd->s_name);
 	sd->s_parent = sysfs_get(acxt->parent_sd);
 
@@ -643,14 +643,14 @@  struct sysfs_dirent *sysfs_find_dirent(struct sysfs_dirent *parent_sd,
 {
 	struct rb_node *node = parent_sd->s_dir.children.rb_node;
 	unsigned int hash;
-#ifndef CONFIG_VE
+
 	if (!!sysfs_ns_type(parent_sd) != !!ns) {
 		WARN(1, KERN_WARNING "sysfs: ns %s in '%s' for '%s'\n",
 			sysfs_ns_type(parent_sd)? "required": "invalid",
 			parent_sd->s_name, name);
 		return NULL;
 	}
-#endif
+
 	hash = sysfs_name_hash(ns, name);
 	while (node) {
 		struct sysfs_dirent *sd;
diff --git a/fs/sysfs/symlink.c b/fs/sysfs/symlink.c
index fa1f4baddfba..8c940df97a52 100644
--- a/fs/sysfs/symlink.c
+++ b/fs/sysfs/symlink.c
@@ -59,10 +59,6 @@  static int sysfs_do_create_link_sd(struct sysfs_dirent *parent_sd,
 	sysfs_addrm_start(&acxt, parent_sd);
 	/* Symlinks must be between directories with the same ns_type */
 	if (!ns_type ||
-#ifdef CONFIG_VE
-	    /* or if target doesn't have ns_type */
-	    !sysfs_ns_type(sd->s_symlink.target_sd->s_parent) ||
-#endif
 	    (ns_type == sysfs_ns_type(sd->s_symlink.target_sd->s_parent))) {
 		if (warn)
 			error = sysfs_add_one(&acxt, sd);