]> git.ipfire.org Git - thirdparty/mdadm.git/commit
mdadm: allow any valid minor number in md device name
authorMartin Wilck <mwilck@suse.com>
Wed, 30 Apr 2025 19:18:36 +0000 (21:18 +0200)
committerMariusz Tkaczyk <mtkaczyk@kernel.org>
Thu, 8 May 2025 07:08:26 +0000 (09:08 +0200)
commite270c8f99e90cf89e0c1a0534547e7b4bf285041
treee46a47b2dcb14bfa6bcfb679175f70b3fdebe949
parent4aa30f1beafc1fed844a0f335e196400adeb1840
mdadm: allow any valid minor number in md device name

Since 25aa732 ("mdadm: numbered names verification"), it is not possible
any more to create arrays /dev/md${N} with N >= 127. The limit has later
been increased to 1024, which is also artificial. The error message printed
by mdadm is misleading, as the problem is not POSIX compatibility here.

  # mdadm -C -v /dev/md9999 --name=foo -l1 -n2 /dev/loop0 /dev/loop1
  mdadm: Value "/dev/md9999" cannot be set as devname. Reason: Not POSIX compatible.

Given that mdadm creates an array with minor number ${N} if the argument is
/dev/md${N}, the natural limit for the number is the highest minor number
available, which is (1 << MINORBITS) with MINORBITS=20 on Linux.

Fixes: 25aa732 ("mdadm: numbered names verification")
Fixes: f786072 ("mdadm: Increase number limit in md device name to 1024.")
Signed-off-by: Martin Wilck <mwilck@suse.com>
util.c