From 2e151027d245a762326dac8e814db9fc59113454 Mon Sep 17 00:00:00 2001 From: David Sterba Date: Fri, 12 Jun 2015 13:18:44 +0200 Subject: 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 --- cmds-receive.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'cmds-receive.c') diff --git a/cmds-receive.c b/cmds-receive.c index 61d7ed89..6e02efdb 100644 --- a/cmds-receive.c +++ b/cmds-receive.c @@ -979,7 +979,7 @@ static int do_receive(struct btrfs_receive *r, const char *tomnt, goto out; } - root_subvol_path = malloc(BTRFS_PATH_NAME_MAX); + root_subvol_path = malloc(PATH_MAX); if (!root_subvol_path) { ret = -ENOMEM; fprintf(stderr, "ERROR: couldn't allocate buffer for the root " @@ -988,7 +988,7 @@ static int do_receive(struct btrfs_receive *r, const char *tomnt, } ret = btrfs_subvolid_resolve(r->mnt_fd, root_subvol_path, - BTRFS_PATH_NAME_MAX, subvol_id); + PATH_MAX, subvol_id); if (ret) { fprintf(stderr, "ERROR: couldn't resolve our subvol path\n"); goto out; -- cgit v1.2.3