From: Mike Lovell Date: Wed, 18 May 2016 18:23:14 +0000 (-0600) Subject: Change behavior in find_free_devnm when wrapping around. X-Git-Tag: mdadm-4.0~84 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2e466cce45ac2397ea426a765c829c621901664b;p=thirdparty%2Fmdadm.git Change behavior in find_free_devnm when wrapping around. Newer kernels don't allow for specifying an array larger than 511. This makes it so find_free_devnm wraps to 511 instead of 2^20 - 1. Signed-off-by: Mike Lovell Signed-off-by: Jes Sorensen --- diff --git a/mdopen.c b/mdopen.c index e71d7586..f818fdf3 100644 --- a/mdopen.c +++ b/mdopen.c @@ -439,7 +439,7 @@ char *find_free_devnm(int use_partitions) static char devnm[32]; int devnum; for (devnum = 127; devnum != 128; - devnum = devnum ? devnum-1 : (1<<20)-1) { + devnum = devnum ? devnum-1 : (1<<9)-1) { if (use_partitions) sprintf(devnm, "md_d%d", devnum);