]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
client: use PATH_MAX for mount path size
authorPatrick Donnelly <pdonnell@redhat.com>
Mon, 27 Nov 2017 18:41:41 +0000 (10:41 -0800)
committerPatrick Donnelly <pdonnell@redhat.com>
Mon, 27 Nov 2017 18:43:32 +0000 (10:43 -0800)
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
src/client/fuse_ll.cc

index 5dee6eac37ea9f7ecbc80c3d3fb22455a27937eb..b8d1238936aa3350fe32d9dc3ef02304be68d2ab 100644 (file)
@@ -15,6 +15,7 @@
 #include <sys/file.h>
 #include <sys/types.h>
 #include <sys/wait.h>
+#include <limits.h>
 #include <signal.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -907,7 +908,7 @@ static int remount_cb(void *handle)
 {
   // used for trimming kernel dcache. when remounting a file system, linux kernel
   // trims all unused dentries in the file system
-  char cmd[1024];
+  char cmd[128+PATH_MAX];
   CephFuse::Handle *cfuse = (CephFuse::Handle *)handle;
   snprintf(cmd, sizeof(cmd), "mount -i -o remount %s", cfuse->mountpoint);
   int r = system(cmd);