Thread (76 messages) 76 messages, 2 authors, 2010-11-30
STALE5716d

[PATCH 18/53] Treat feature as experimental

From: Adam Kwolek <hidden>
Date: 2010-11-26 08:06:08
Subsystem: the rest · Maintainer: Linus Torvalds

Due to fact that IMSM Windows compatibility was not tested yet, feature has to be treated as experimental until compatibility verification will be performed.

Signed-off-by: Adam Kwolek <redacted>
---

 mdadm.h       |    1 +
 super-intel.c |    4 ++++
 util.c        |   10 ++++++++++
 3 files changed, 15 insertions(+), 0 deletions(-)
diff --git a/mdadm.h b/mdadm.h
index 64b32cc..bf3c1d3 100644
--- a/mdadm.h
+++ b/mdadm.h
@@ -890,6 +890,7 @@ extern char *conf_word(FILE *file, int allow_key);
 extern int conf_name_is_free(char *name);
 extern int devname_matches(char *name, char *match);
 extern struct mddev_ident_s *conf_match(struct mdinfo *info, struct supertype *st);
+extern inline int experimental(void);
 
 extern void free_line(char *line);
 extern int match_oneof(char *devices, char *devname);
diff --git a/super-intel.c b/super-intel.c
index 2434fa1..f092ccc 100644
--- a/super-intel.c
+++ b/super-intel.c
@@ -5780,6 +5780,10 @@ int imsm_reshape_super(struct supertype *st, long long size, int level,
 	int fd = -1;
 	char buf[PATH_MAX];
 
+
+	if (experimental() == 0)
+		return ret_val;
+
 	snprintf(buf, PATH_MAX, "/dev/md%i", st->devnum);
 	fd = open(buf , O_RDONLY | O_DIRECT);
 	if (fd < 0) {
diff --git a/util.c b/util.c
index 8739278..f220792 100644
--- a/util.c
+++ b/util.c
@@ -1859,3 +1859,13 @@ void append_metadata_update(struct supertype *st, void *buf, int len)
 unsigned int __invalid_size_argument_for_IOC = 0;
 #endif
 
+inline int experimental(void)
+{
+	if (check_env("MDADM_EXPERIMENTAL"))
+		return 1;
+	else {
+		fprintf(stderr, Name "(IMSM): To use this feature MDADM_EXPERIMENTAL enviroment variable has to defined.\n");
+		return 0;
+	}
+}
+
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help