summaryrefslogtreecommitdiff
path: root/cmds-scrub.c
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.cz>2015-06-12 13:18:44 +0200
committerDavid Sterba <dsterba@suse.cz>2015-06-12 16:44:47 +0200
commit2e151027d245a762326dac8e814db9fc59113454 (patch)
treea0292aca05d9a016513dd4876dc275c6874b025e /cmds-scrub.c
parentc55415e4cb246265b1cfc1507b3ec1bdba0e3bb3 (diff)
btrfs-progs: use PATH_MAX instead of BTRFS_PATH_NAME_MAX
The path bufferes should be PATH_MAX but BTRFS_PATH_NAME_MAX is shorter due to embedding in 4k aligned structures. The only reason to use BTRFS_PATH_NAME_MAX is for the respective structures btrfs_ioctl_vol_args::name. Signed-off-by: David Sterba <dsterba@suse.cz>
Diffstat (limited to 'cmds-scrub.c')
-rw-r--r--cmds-scrub.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/cmds-scrub.c b/cmds-scrub.c
index 9ef421d6..b7aa8091 100644
--- a/cmds-scrub.c
+++ b/cmds-scrub.c
@@ -390,7 +390,7 @@ static int scrub_open_file(const char *datafile, int m)
static int scrub_open_file_r(const char *fn_base, const char *fn_local)
{
int ret;
- char datafile[BTRFS_PATH_NAME_MAX + 1];
+ char datafile[PATH_MAX];
ret = scrub_datafile(fn_base, fn_local, NULL,
datafile, sizeof(datafile));
if (ret < 0)
@@ -402,7 +402,7 @@ static int scrub_open_file_w(const char *fn_base, const char *fn_local,
const char *tmp)
{
int ret;
- char datafile[BTRFS_PATH_NAME_MAX + 1];
+ char datafile[PATH_MAX];
ret = scrub_datafile(fn_base, fn_local, tmp,
datafile, sizeof(datafile));
if (ret < 0)
@@ -414,8 +414,8 @@ static int scrub_rename_file(const char *fn_base, const char *fn_local,
const char *tmp)
{
int ret;
- char datafile_old[BTRFS_PATH_NAME_MAX + 1];
- char datafile_new[BTRFS_PATH_NAME_MAX + 1];
+ char datafile_old[PATH_MAX];
+ char datafile_new[PATH_MAX];
ret = scrub_datafile(fn_base, fn_local, tmp,
datafile_old, sizeof(datafile_old));
if (ret < 0)
@@ -1128,7 +1128,7 @@ static int scrub_start(int argc, char **argv, int resume)
struct scrub_file_record *last_scrub = NULL;
char *datafile = strdup(SCRUB_DATA_FILE);
char fsid[BTRFS_UUID_UNPARSED_SIZE];
- char sock_path[BTRFS_PATH_NAME_MAX + 1] = "";
+ char sock_path[PATH_MAX] = "";
struct scrub_progress_cycle spc;
pthread_mutex_t spc_write_mutex = PTHREAD_MUTEX_INITIALIZER;
void *terr;