]> granicus.if.org Git - strace/commitdiff
btrfs.c: do not use BTRFS_SUBVOL_NAME_MAX
authorDmitry V. Levin <ldv@altlinux.org>
Tue, 24 May 2016 00:59:40 +0000 (00:59 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Tue, 24 May 2016 14:52:27 +0000 (14:52 +0000)
* btrfs.c [BTRFS_SUBVOL_NAME_MAX]: Remove.
(btrfs_ioctl): Use sizeof(struct btrfs_ioctl_vol_args_v2.name)
instead of BTRFS_SUBVOL_NAME_MAX + 1.

btrfs.c

diff --git a/btrfs.c b/btrfs.c
index dbf3d736dae6b8db128600db98fad582862f80ee..10625c7cad9c17a0ab0d73a55687d9504d3a4616 100644 (file)
--- a/btrfs.c
+++ b/btrfs.c
@@ -55,10 +55,6 @@ struct btrfs_ioctl_defrag_range_args {
 };
 #endif
 
-#ifndef BTRFS_SUBVOL_NAME_MAX
-# define BTRFS_SUBVOL_NAME_MAX 4039
-#endif
-
 #ifndef BTRFS_LABEL_SIZE
 # define BTRFS_LABEL_SIZE 256
 #endif
@@ -1326,11 +1322,9 @@ btrfs_ioctl(struct tcb *tcp, const unsigned int code, const long arg)
 
                                btrfs_print_qgroup_inherit(tcp,
                                        (unsigned long)args.qgroup_inherit);
-
                        }
                        tprintf(", name=");
-                       print_quoted_string(args.name,
-                                           BTRFS_SUBVOL_NAME_MAX + 1,
+                       print_quoted_string(args.name, sizeof(args.name),
                                            QUOTE_0_TERMINATED);
                        tprints("}");
                        return 0;