Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1420912
| From | Philipp Reisner <philipp.reisner@linbit.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 09/30] drbd: fix for truncated minor number in callback command line |
| Date | 2016-06-13 16:30 +0200 |
| Message-ID | <rJB2h-7sn-9@gated-at.bofh.it> (permalink) |
| References | <rJASB-7p1-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
From: Lars Ellenberg <lars.ellenberg@linbit.com>
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 <lars.ellenberg@linbit.com>
---
drivers/block/drbd/drbd_nl.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/block/drbd/drbd_nl.c b/drivers/block/drbd/drbd_nl.c
index 99339df..3643f9c 100644
--- a/drivers/block/drbd/drbd_nl.c
+++ b/drivers/block/drbd/drbd_nl.c
@@ -343,7 +343,7 @@ int drbd_khelper(struct drbd_device *device, char *cmd)
(char[20]) { }, /* address family */
(char[60]) { }, /* address */
NULL };
- char mb[12];
+ char mb[14];
char *argv[] = {usermode_helper, cmd, mb, NULL };
struct drbd_connection *connection = first_peer_device(device)->connection;
struct sib_info sib;
@@ -352,7 +352,7 @@ int drbd_khelper(struct drbd_device *device, char *cmd)
if (current == connection->worker.task)
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);
/* The helper may take some time.
--
2.7.4
Back to linux.kernel | Previous | Next | Find similar | Unroll thread
[PATCH 09/30] drbd: fix for truncated minor number in callback command line Philipp Reisner <philipp.reisner@linbit.com> - 2016-06-13 16:30 +0200
csiph-web