提交 2b8a90b5 编写于 作者: P Philipp Reisner

drbd: Corrected off-by-one error in DRBD_MINOR_COUNT_MAX

Signed-off-by: NPhilipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: NLars Ellenberg <lars.ellenberg@linbit.com>
上级 110a204a
...@@ -85,7 +85,8 @@ MODULE_AUTHOR("Philipp Reisner <phil@linbit.com>, " ...@@ -85,7 +85,8 @@ MODULE_AUTHOR("Philipp Reisner <phil@linbit.com>, "
MODULE_DESCRIPTION("drbd - Distributed Replicated Block Device v" REL_VERSION); MODULE_DESCRIPTION("drbd - Distributed Replicated Block Device v" REL_VERSION);
MODULE_VERSION(REL_VERSION); MODULE_VERSION(REL_VERSION);
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
MODULE_PARM_DESC(minor_count, "Maximum number of drbd devices (1-255)"); MODULE_PARM_DESC(minor_count, "Maximum number of drbd devices ("
__stringify(DRBD_MINOR_COUNT_MIN) "-" __stringify(DRBD_MINOR_COUNT_MAX) ")");
MODULE_ALIAS_BLOCKDEV_MAJOR(DRBD_MAJOR); MODULE_ALIAS_BLOCKDEV_MAJOR(DRBD_MAJOR);
#include <linux/moduleparam.h> #include <linux/moduleparam.h>
...@@ -115,7 +116,7 @@ module_param(fault_devs, int, 0644); ...@@ -115,7 +116,7 @@ module_param(fault_devs, int, 0644);
#endif #endif
/* module parameter, defined */ /* module parameter, defined */
unsigned int minor_count = 32; unsigned int minor_count = DRBD_MINOR_COUNT_DEF;
int disable_sendpage; int disable_sendpage;
int allow_oos; int allow_oos;
unsigned int cn_idx = CN_IDX_DRBD; unsigned int cn_idx = CN_IDX_DRBD;
...@@ -3456,7 +3457,7 @@ int __init drbd_init(void) ...@@ -3456,7 +3457,7 @@ int __init drbd_init(void)
return -EINVAL; return -EINVAL;
} }
if (1 > minor_count || minor_count > 255) { if (minor_count < DRBD_MINOR_COUNT_MIN || minor_count > DRBD_MINOR_COUNT_MAX) {
printk(KERN_ERR printk(KERN_ERR
"drbd: invalid minor_count (%d)\n", minor_count); "drbd: invalid minor_count (%d)\n", minor_count);
#ifdef MODULE #ifdef MODULE
......
...@@ -16,7 +16,8 @@ ...@@ -16,7 +16,8 @@
#define DEBUG_RANGE_CHECK 0 #define DEBUG_RANGE_CHECK 0
#define DRBD_MINOR_COUNT_MIN 1 #define DRBD_MINOR_COUNT_MIN 1
#define DRBD_MINOR_COUNT_MAX 255 #define DRBD_MINOR_COUNT_MAX 256
#define DRBD_MINOR_COUNT_DEF 32
#define DRBD_DIALOG_REFRESH_MIN 0 #define DRBD_DIALOG_REFRESH_MIN 0
#define DRBD_DIALOG_REFRESH_MAX 600 #define DRBD_DIALOG_REFRESH_MAX 600
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册