Blame SOURCES/0048-mdadm-remove-symlink-option.patch

b33395
From e4a030a0d3a953b8e74c118200e58dc83c2fc608 Mon Sep 17 00:00:00 2001
b33395
From: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
b33395
Date: Tue, 19 Jul 2022 14:48:22 +0200
b33395
Subject: [PATCH 48/52] mdadm: remove symlink option
b33395
b33395
The option is not used. Remove it from code.
b33395
b33395
Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
b33395
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
b33395
---
b33395
 ReadMe.c        |  1 -
b33395
 config.c        |  7 +------
b33395
 mdadm.8.in      |  9 ---------
b33395
 mdadm.c         | 20 --------------------
b33395
 mdadm.conf.5.in | 15 ---------------
b33395
 mdadm.h         |  2 --
b33395
 6 files changed, 1 insertion(+), 53 deletions(-)
b33395
b33395
diff --git a/ReadMe.c b/ReadMe.c
b33395
index 7518a32a..7f94847e 100644
b33395
--- a/ReadMe.c
b33395
+++ b/ReadMe.c
b33395
@@ -147,7 +147,6 @@ struct option long_options[] = {
b33395
     {"nofailfast",0, 0,  NoFailFast},
b33395
     {"re-add",    0, 0,  ReAdd},
b33395
     {"homehost",  1, 0,  HomeHost},
b33395
-    {"symlinks",  1, 0,  Symlinks},
b33395
     {"data-offset",1, 0, DataOffset},
b33395
     {"nodes",1, 0, Nodes}, /* also for --assemble */
b33395
     {"home-cluster",1, 0, ClusterName},
b33395
diff --git a/config.c b/config.c
b33395
index 9c725457..dc1620c1 100644
b33395
--- a/config.c
b33395
+++ b/config.c
b33395
@@ -194,7 +194,6 @@ struct mddev_dev *load_containers(void)
b33395
 
b33395
 struct createinfo createinfo = {
b33395
 	.autof = 2, /* by default, create devices with standard names */
b33395
-	.symlinks = 1,
b33395
 	.names = 0, /* By default, stick with numbered md devices. */
b33395
 	.bblist = 1, /* Use a bad block list by default */
b33395
 #ifdef DEBIAN
b33395
@@ -310,11 +309,7 @@ static void createline(char *line)
b33395
 			if (!createinfo.supertype)
b33395
 				pr_err("metadata format %s unknown, ignoring\n",
b33395
 					w+9);
b33395
-		} else if (strncasecmp(w, "symlinks=yes", 12) == 0)
b33395
-			createinfo.symlinks = 1;
b33395
-		else if  (strncasecmp(w, "symlinks=no", 11) == 0)
b33395
-			createinfo.symlinks = 0;
b33395
-		else if (strncasecmp(w, "names=yes", 12) == 0)
b33395
+		} else if (strncasecmp(w, "names=yes", 12) == 0)
b33395
 			createinfo.names = 1;
b33395
 		else if  (strncasecmp(w, "names=no", 11) == 0)
b33395
 			createinfo.names = 0;
b33395
diff --git a/mdadm.8.in b/mdadm.8.in
b33395
index 0be02e4a..f2736226 100644
b33395
--- a/mdadm.8.in
b33395
+++ b/mdadm.8.in
b33395
@@ -1048,11 +1048,6 @@ simultaneously. If not specified, this defaults to 4.
b33395
 Specify journal device for the RAID-4/5/6 array. The journal device
b33395
 should be a SSD with reasonable lifetime.
b33395
 
b33395
-.TP
b33395
-.BR \-\-symlinks
b33395
-Auto creation of symlinks in /dev to /dev/md, option --symlinks must
b33395
-be 'no' or 'yes' and work with --create and --build.
b33395
-
b33395
 .TP
b33395
 .BR \-k ", " \-\-consistency\-policy=
b33395
 Specify how the array maintains consistency in case of unexpected shutdown.
b33395
@@ -1405,10 +1400,6 @@ Reshape can be continued later using the
b33395
 .B \-\-continue
b33395
 option for the grow command.
b33395
 
b33395
-.TP
b33395
-.BR \-\-symlinks
b33395
-See this option under Create and Build options.
b33395
-
b33395
 .SH For Manage mode:
b33395
 
b33395
 .TP
b33395
diff --git a/mdadm.c b/mdadm.c
b33395
index 56722ed9..180f7a9c 100644
b33395
--- a/mdadm.c
b33395
+++ b/mdadm.c
b33395
@@ -59,7 +59,6 @@ int main(int argc, char *argv[])
b33395
 	struct mddev_dev *dv;
b33395
 	mdu_array_info_t array;
b33395
 	int devs_found = 0;
b33395
-	char *symlinks = NULL;
b33395
 	int grow_continue = 0;
b33395
 	/* autof indicates whether and how to create device node.
b33395
 	 * bottom 3 bits are style.  Rest (when shifted) are number of parts
b33395
@@ -663,13 +662,6 @@ int main(int argc, char *argv[])
b33395
 		case O(ASSEMBLE,Auto): /* auto-creation of device node */
b33395
 			c.autof = parse_auto(optarg, "--auto flag", 0);
b33395
 			continue;
b33395
-
b33395
-		case O(CREATE,Symlinks):
b33395
-		case O(BUILD,Symlinks):
b33395
-		case O(ASSEMBLE,Symlinks): /* auto creation of symlinks in /dev to /dev/md */
b33395
-			symlinks = optarg;
b33395
-			continue;
b33395
-
b33395
 		case O(BUILD,'f'): /* force honouring '-n 1' */
b33395
 		case O(BUILD,Force): /* force honouring '-n 1' */
b33395
 		case O(GROW,'f'): /* ditto */
b33395
@@ -1325,18 +1317,6 @@ int main(int argc, char *argv[])
b33395
 		exit(2);
b33395
 	}
b33395
 
b33395
-	if (symlinks) {
b33395
-		struct createinfo *ci = conf_get_create_info();
b33395
-
b33395
-		if (strcasecmp(symlinks, "yes") == 0)
b33395
-			ci->symlinks = 1;
b33395
-		else if (strcasecmp(symlinks, "no") == 0)
b33395
-			ci->symlinks = 0;
b33395
-		else {
b33395
-			pr_err("option --symlinks must be 'no' or 'yes'\n");
b33395
-			exit(2);
b33395
-		}
b33395
-	}
b33395
 	/* Ok, got the option parsing out of the way
b33395
 	 * hopefully it's mostly right but there might be some stuff
b33395
 	 * missing
b33395
diff --git a/mdadm.conf.5.in b/mdadm.conf.5.in
b33395
index cd4e6a9d..bc2295c2 100644
b33395
--- a/mdadm.conf.5.in
b33395
+++ b/mdadm.conf.5.in
b33395
@@ -338,21 +338,6 @@ missing device entries should be created.
b33395
 The name of the metadata format to use if none is explicitly given.
b33395
 This can be useful to impose a system-wide default of version-1 superblocks.
b33395
 
b33395
-.TP
b33395
-.B symlinks=no
b33395
-Normally when creating devices in
b33395
-.B /dev/md/
b33395
-.I mdadm
b33395
-will create a matching symlink from
b33395
-.B /dev/
b33395
-with a name starting
b33395
-.B md
b33395
-or
b33395
-.BR md_ .
b33395
-Give
b33395
-.B symlinks=no
b33395
-to suppress this symlink creation.
b33395
-
b33395
 .TP
b33395
 .B names=yes
b33395
 Since Linux 2.6.29 it has been possible to create
b33395
diff --git a/mdadm.h b/mdadm.h
b33395
index add9c0b6..93e72786 100644
b33395
--- a/mdadm.h
b33395
+++ b/mdadm.h
b33395
@@ -394,7 +394,6 @@ struct createinfo {
b33395
 	int	gid;
b33395
 	int	autof;
b33395
 	int	mode;
b33395
-	int	symlinks;
b33395
 	int	names;
b33395
 	int	bblist;
b33395
 	struct supertype *supertype;
b33395
@@ -442,7 +441,6 @@ enum special_options {
b33395
 	BackupFile,
b33395
 	HomeHost,
b33395
 	AutoHomeHost,
b33395
-	Symlinks,
b33395
 	AutoDetect,
b33395
 	Waitclean,
b33395
 	DetailPlatform,
b33395
-- 
b33395
2.31.1
b33395