drbd: Fix the maximum accepted minor device number
authorAndreas Gruenbacher <agruen@linbit.com>
Wed, 13 Jul 2011 11:40:30 +0000 (13:40 +0200)
committerPhilipp Reisner <philipp.reisner@linbit.com>
Thu, 8 Nov 2012 15:57:54 +0000 (16:57 +0100)
The maximum minor device number allowed by the kernel is (1<<20 - 1).  Reject
device numbers higher than that to earlier catch possible errors.

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
include/linux/drbd_limits.h

index cd3565cfed4413aecc78da313e7b386b19f5344c..7d956e91ae7be8081d9f7b8bbce6bc012a5563e9 100644 (file)
 #define DRBD_AL_EXTENTS_SCALE '1'
 
 #define DRBD_MINOR_NUMBER_MIN  -1
-#define DRBD_MINOR_NUMBER_MAX  (1<<30)
+#define DRBD_MINOR_NUMBER_MAX  ((1 << 20) - 1)
 #define DRBD_MINOR_NUMBER_DEF  -1
 #define DRBD_MINOR_NUMBER_SCALE '1'