diff mbox

Re: your dm patch for strace

Message ID 20161005.192828.566127461630656590.yamato@redhat.com (mailing list archive)
State Not Applicable, archived
Delegated to: Mike Snitzer
Headers show

Commit Message

Masatake YAMATO Oct. 5, 2016, 10:28 a.m. UTC
I tested the patch and it works fine.
Could you add following patch if you approve?

commit bae7528fa92283726caac1ec7a6c306274f8899d
Author: Masatake YAMATO <yamato@redhat.com>
Date:   Mon Aug 22 17:44:55 2016 +0900

    dm-ioctl: add a lvm private flag
    
    When I run "dmsetup ls" under dm-ioctl patched strace,
    "strange DM_???" are found in its output.
    
        # ./strace -e ioctl dmsetup ls > /dev/null
        ioctl(3, DM_VERSION, {version=4.0.0, flags=0x4 /* DM_??? */}, ...
        ioctl(3, DM_LIST_DEVICES, {version=4.0.0, flags=0x4 /* DM_??? */}, ...
        ...
    
    Associated definion for DM_??? is in lvm2 source tree. This commit
    imports the definion to dm-ioctl list.
    
    Signed-off-by: Masatake YAMATO <yamato@redhat.com>


--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel

Comments

Eugene Syromyatnikov Oct. 9, 2016, 1:27 p.m. UTC | #1
Hello.

I've took the liberty to look at the patch and I'd like to propose some
changes to it. Can you please review them from the DM side of things?
I'm not quite sure I've understood all the specifics of the interface correctly,
it's quite peculiar.

I'm also preparing a patch for the DM ioctl decoder test, but it's not ready
yet.

Eugene Syromyatnikov (21):
  tests/ioctl_dm: Formatting
  dm: whitespace fixes
  tests: Working around bounds check
  dm: Minor output tweaks
  xlat: Add values for dm_flags
  dm: Some future-proofing by means of compile-time DM_VERSION_MAJOR
    check
  dm: Add definitions for ioctl commands not implemented initially
  dm: Use static constants for offset sizes
  dm: Remove char * cast
  dm: use => instead of , for splitting output structure from input
  dm: Compare entering field values with exiting ones
  dm: Add inttypes.h, include reorder
  dm: Move printing of dm_ioctl fields before allocation of extra data
  dm: replace abbrev branching with goto
  dm: Additional data_size/data_start checks
  dm: Add comment regarding intended fall-through in switch statement
  dm: Add data_size and data_offset fields to output
  tests/ioctl_dm: Allow passing size and data_start to init_s
  dm: Add check whether command uses parameters
  dm: Fix printing of version field
  dm: rewrite structure decoding

 dm.c             |  549 ++++++++++++++++++++++++++++++++++++------------------
 tests/ioctl_dm.c |   79 +++++---
 xlat/dm_flags.in |   36 ++--
 3 files changed, 442 insertions(+), 222 deletions(-)
Eugene Syromyatnikov Oct. 11, 2016, 10:38 p.m. UTC | #2
Hello.

Aside from additional checks themselves, this patchset also contains two
notable changes:
 * Fix for the previous patchset - misplaced comma printing ("dm: Fix comma
   printing for the case when dm_target_msg structure is inaccessible").
 * Update of printstr_ex call, which enables proper handling of
   QUOTE_0_TERMINATED user style (it prints cropped string without ellipsis
   otherwise).

Eugene Syromyatnikov (9):
  util: Add support for QUOTE_0_TERMINATED in user_style to
    ptrintstr_ex
  tests: Add check for printing of overlength strings to ioctl_dm test
  tests: Add check for presence of HAVE_LINUX_DM_IOCTL_H macro
    definition to ioctl_dm test
  tests/ioctl_dm: whitespace
  dm: Fix comma printing for the case when dm_target_msg structure is
    inaccessible
  tests/ioctl_dm: overly long string printing checks
  tests: Some additional checks for ioctl_dm test
  tests: Add ioctl_dm to .gitignore
  tests: Add checks for abbreviated DM ioctl output

 dm.c                  |    4 +-
 tests/.gitignore      |    2 +
 tests/Makefile.am     |    2 +
 tests/ioctl_dm-v.c    |    2 +
 tests/ioctl_dm-v.test |   12 +
 tests/ioctl_dm.c      |  653 +++++++++++++++++++++++++++++++++++++++++++++++--
 tests/ioctl_dm.test   |    2 +-
 util.c                |   18 +-
 8 files changed, 674 insertions(+), 21 deletions(-)
 create mode 100644 tests/ioctl_dm-v.c
 create mode 100755 tests/ioctl_dm-v.test
diff mbox

Patch

diff --git a/xlat/dm_flags.in b/xlat/dm_flags.in
index ab4285c..1e7132b 100644
--- a/xlat/dm_flags.in
+++ b/xlat/dm_flags.in
@@ -1,5 +1,7 @@ 
 DM_READONLY_FLAG
 DM_SUSPEND_FLAG
+/* Defined in lvm2/libdm/ioctl/libdm-iface.c */
+DM_EXISTS_FLAG 0x00000004
 DM_PERSISTENT_DEV_FLAG
 DM_STATUS_TABLE_FLAG
 DM_ACTIVE_PRESENT_FLAG