aboutsummaryrefslogtreecommitdiffstats
path: root/cmds-receive.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-receive.c
parentc55415e4cb246265b1cfc1507b3ec1bdba0e3bb3 (diff)
downloadbtrfs-progs-2e151027d245a762326dac8e814db9fc59113454.tar.gz
btrfs-progs-2e151027d245a762326dac8e814db9fc59113454.tar.xz
btrfs-progs-2e151027d245a762326dac8e814db9fc59113454.zip
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-receive.c')
-rw-r--r--cmds-receive.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/cmds-receive.c b/cmds-receive.c
index 61d7ed8..6e02efd 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;