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

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