]> granicus.if.org Git - strace/commitdiff
btrfs: fix printing of struct btrfs_ioctl_quota_ctl_args
authorEugene Syromyatnikov <evgsyr@gmail.com>
Mon, 19 Mar 2018 04:22:42 +0000 (05:22 +0100)
committerDmitry V. Levin <ldv@altlinux.org>
Fri, 20 Apr 2018 12:39:05 +0000 (12:39 +0000)
For some reason, he decoder of BTRFS_IOC_QUOTA_CTL command didn't print
opening curly brace and field name, only the closing curly brace.

* btrfs.c (MPERS_PRINTER_DECL(btrfs_ioctl)) <case BTRFS_IOC_QUOTA_CTL>:
Print "{cmd=".
* tests/btrfs.c (btrfs_test_quota_ctl_ioctl): Update expected output.

Fixes: v4.12~100 "ioctl: add decoding support for btrfs ioctls"
btrfs.c
tests/btrfs.c

diff --git a/btrfs.c b/btrfs.c
index 7f17bf605f7e6564c9f9e8fcbc804ee7e30fc59a..61a15d2f148370bd523f71fa533a33920c80220c 100644 (file)
--- a/btrfs.c
+++ b/btrfs.c
@@ -985,6 +985,7 @@ MPERS_PRINTER_DECL(int, btrfs_ioctl,
                if (umove_or_printaddr(tcp, arg, &args))
                        break;
 
+               tprints("{cmd=");
                printxval64(btrfs_qgroup_ctl_cmds, args.cmd,
                            "BTRFS_QUOTA_CTL_???");
                tprints("}");
index 69579f4c45214136fb3f502208b2ab3157631a13..aed6d7027bbfe2bec1d5ce28cf483dbf9e1efafc 100644 (file)
@@ -1503,28 +1503,28 @@ btrfs_test_quota_ctl_ioctl(void)
 
        ioctl(-1, BTRFS_IOC_QUOTA_CTL, &args);
        printf("ioctl(-1, BTRFS_IOC_QUOTA_CTL, "
-              "%sBTRFS_QUOTA_CTL_ENABLE%s}) = -1 EBADF (%m)\n",
+              "{cmd=%sBTRFS_QUOTA_CTL_ENABLE%s}) = -1 EBADF (%m)\n",
               verbose_xlat ? "0x1 /* " : "",
               verbose_xlat ? " */" : "");
 
        args.cmd = 2;
        ioctl(-1, BTRFS_IOC_QUOTA_CTL, &args);
        printf("ioctl(-1, BTRFS_IOC_QUOTA_CTL, "
-              "%sBTRFS_QUOTA_CTL_DISABLE%s}) = -1 EBADF (%m)\n",
+              "{cmd=%sBTRFS_QUOTA_CTL_DISABLE%s}) = -1 EBADF (%m)\n",
               verbose_xlat ? "0x2 /* " : "",
               verbose_xlat ? " */" : "");
 
        args.cmd = 3;
        ioctl(-1, BTRFS_IOC_QUOTA_CTL, &args);
        printf("ioctl(-1, BTRFS_IOC_QUOTA_CTL, "
-              "%sBTRFS_QUOTA_CTL_RESCAN__NOTUSED%s}) = -1 EBADF (%m)\n",
+              "{cmd=%sBTRFS_QUOTA_CTL_RESCAN__NOTUSED%s}) = -1 EBADF (%m)\n",
               verbose_xlat ? "0x3 /* " : "",
               verbose_xlat ? " */" : "");
 
        args.cmd = 4;
        ioctl(-1, BTRFS_IOC_QUOTA_CTL, &args);
        printf("ioctl(-1, BTRFS_IOC_QUOTA_CTL, "
-              "0x4 /* BTRFS_QUOTA_CTL_??? */}) = -1 EBADF (%m)\n");
+              "{cmd=0x4 /* BTRFS_QUOTA_CTL_??? */}) = -1 EBADF (%m)\n");
 }
 
 /*