From 8d6fd581fbc4244cc342684b0348861c40c2ada1 Mon Sep 17 00:00:00 2001 From: Eugene Syromyatnikov Date: Mon, 19 Mar 2018 05:22:42 +0100 Subject: [PATCH] btrfs: fix printing of struct btrfs_ioctl_quota_ctl_args 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)) : 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 | 1 + tests/btrfs.c | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/btrfs.c b/btrfs.c index 7f17bf60..61a15d2f 100644 --- 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("}"); diff --git a/tests/btrfs.c b/tests/btrfs.c index 69579f4c..aed6d702 100644 --- a/tests/btrfs.c +++ b/tests/btrfs.c @@ -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"); } /* -- 2.40.0