Skip to content

Commit 0982368

Browse files
lgeaxboe
authored andcommitted
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: Lars Ellenberg <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
1 parent 1b228c9 commit 0982368

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/block/drbd/drbd_nl.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ int drbd_khelper(struct drbd_device *device, char *cmd)
343343
(char[20]) { }, /* address family */
344344
(char[60]) { }, /* address */
345345
NULL };
346-
char mb[12];
346+
char mb[14];
347347
char *argv[] = {usermode_helper, cmd, mb, NULL };
348348
struct drbd_connection *connection = first_peer_device(device)->connection;
349349
struct sib_info sib;
@@ -352,7 +352,7 @@ int drbd_khelper(struct drbd_device *device, char *cmd)
352352
if (current == connection->worker.task)
353353
set_bit(CALLBACK_PENDING, &connection->flags);
354354

355-
snprintf(mb, 12, "minor-%d", device_to_minor(device));
355+
snprintf(mb, 14, "minor-%d", device_to_minor(device));
356356
setup_khelper_env(connection, envp);
357357

358358
/* The helper may take some time.

0 commit comments

Comments
 (0)