client: use PATH_MAX for mount path size

Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
This commit is contained in:
Patrick Donnelly 2017-11-27 10:41:41 -08:00
parent 54e51fd3c3
commit ced416aa64
No known key found for this signature in database
GPG Key ID: 3A2A7E25BEA8AADB

View 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);