]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Lib.c: Fix geting devname for devices with long path
authorPawel Baldysiak <pawel.baldysiak@intel.com>
Fri, 21 Oct 2016 09:37:51 +0000 (11:37 +0200)
committerJes Sorensen <Jes.Sorensen@redhat.com>
Wed, 26 Oct 2016 16:03:25 +0000 (12:03 -0400)
In scenario where VMD is enabled, and "x8" type of NVMe drive is
plugged into PCIe switch - the path will be longer than 200 chars
(additional VMD domain + 2 level of PCIe switches).
This patch makes the buffer big enough to handle this kind of
configurations.

Signed-off-by: Pawel Baldysiak <pawel.baldysiak@intel.com>
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
lib.c

diff --git a/lib.c b/lib.c
index 057ee52311f14ed8b3c03de90783c2ddfe94dcc0..b640634ef6f2e7cff7c5512cc2706f59c0d0ac0f 100644 (file)
--- a/lib.c
+++ b/lib.c
@@ -64,7 +64,7 @@ int get_mdp_major(void)
 char *devid2kname(int devid)
 {
        char path[30];
-       char link[200];
+       char link[PATH_MAX];
        static char devnm[32];
        char *cp;
        int n;