Commit 0982368b authored by Lars Ellenberg's avatar Lars Ellenberg Committed by Jens Axboe

drbd: fix for truncated minor number in callback command line

The command line parameter the kernel module uses to communicate the
device minor to userland helper is flawed in a way that the device
indentifier "minor-%d" is being truncated to minors with a maximum
of 5 digits.

But DRBD 8.4 allows 2^20 == 1048576 minors,
thus a minimum of 7 digits must be supported.

Reported by Veit Wahlich on drbd-dev.
Signed-off-by: default avatarLars Ellenberg <lars.ellenberg@linbit.com>
Signed-off-by: default avatarJens Axboe <axboe@fb.com>
parent 1b228c98
...@@ -343,7 +343,7 @@ int drbd_khelper(struct drbd_device *device, char *cmd) ...@@ -343,7 +343,7 @@ int drbd_khelper(struct drbd_device *device, char *cmd)
(char[20]) { }, /* address family */ (char[20]) { }, /* address family */
(char[60]) { }, /* address */ (char[60]) { }, /* address */
NULL }; NULL };
char mb[12]; char mb[14];
char *argv[] = {usermode_helper, cmd, mb, NULL }; char *argv[] = {usermode_helper, cmd, mb, NULL };
struct drbd_connection *connection = first_peer_device(device)->connection; struct drbd_connection *connection = first_peer_device(device)->connection;
struct sib_info sib; struct sib_info sib;
...@@ -352,7 +352,7 @@ int drbd_khelper(struct drbd_device *device, char *cmd) ...@@ -352,7 +352,7 @@ int drbd_khelper(struct drbd_device *device, char *cmd)
if (current == connection->worker.task) if (current == connection->worker.task)
set_bit(CALLBACK_PENDING, &connection->flags); set_bit(CALLBACK_PENDING, &connection->flags);
snprintf(mb, 12, "minor-%d", device_to_minor(device)); snprintf(mb, 14, "minor-%d", device_to_minor(device));
setup_khelper_env(connection, envp); setup_khelper_env(connection, envp);
/* The helper may take some time. /* The helper may take some time.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment