Problem:

    mpath_recv_reply() return -EINVA with 2k paths.

Root cause:

    With 2k paths(1k mpaths) simulated by scsi_debug, the 'show maps json'
    requires 1633217 bytes while MAX_REPLY_LEN is 65535 bytes.

Fix:

    Increase MAX_REPLY_LEN to 10485760(10MiB) which is enough for 10k
    paths.

Signed-off-by: Gris Ge <[email protected]>
---
 libmpathcmd/mpath_cmd.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libmpathcmd/mpath_cmd.h b/libmpathcmd/mpath_cmd.h
index f33f000..d65c648 100644
--- a/libmpathcmd/mpath_cmd.h
+++ b/libmpathcmd/mpath_cmd.h
@@ -28,7 +28,9 @@ extern "C" {
 
 #define DEFAULT_SOCKET         "/org/kernel/linux/storage/multipathd"
 #define DEFAULT_REPLY_TIMEOUT  1000
-#define MAX_REPLY_LEN          65536
+#define MAX_REPLY_LEN          10485760
+/* ^ 10 MiB, enough for 'show maps json' command with 10k paths which
+ *   requires about 8 MiB */
 
 
 /*
-- 
2.9.0

--
dm-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/dm-devel

Reply via email to