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

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