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

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