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 <mlovell@bluehost.com>
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
This commit is contained in:
Mike Lovell 2016-05-18 12:23:14 -06:00 committed by Jes Sorensen
parent 13db17bd1f
commit 2e466cce45
1 changed files with 1 additions and 1 deletions

View File

@ -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);