Rewrite structure decoding in attempt to make it more in line with how
structures and arrays are decoded in strace.
* Replace single structure retrieval with on-demand retrieval. It
allows limiting amount of memory being allocated (suppose ioctl with
data_size = -1)
* Check for abbrev in st
---
tests/ioctl_dm.c | 34 --
1 file changed, 16 insertions(+), 18 deletions(-)
diff --git a/tests/ioctl_dm.c b/tests/ioctl_dm.c
index 6967ca2..c120ed2 100644
--- a/tests/ioctl_dm.c
+++ b/tests/ioctl_dm.c
@@ -21,32 +21,30 @@ static struct s {
} u;
} s;
---
dm.c | 25 ++---
tests/ioctl_dm.c |2 +-
2 files changed, 23 insertions(+), 4 deletions(-)
diff --git a/dm.c b/dm.c
index caffc55..a48aa72 100644
--- a/dm.c
+++ b/dm.c
@@ -281,6 +281,23 @@ dm_decode_string(const struct dm_ioctl *ioc, const char
*extra,
This may improve readability an leads to more compact code.
---
dm.c | 58 +++---
1 file changed, 31 insertions(+), 27 deletions(-)
diff --git a/dm.c b/dm.c
index 66b615d..adfa97e 100644
--- a/dm.c
+++ b/dm.c
@@ -102,12 +102,14 @@ static void
---
dm.c |6 +-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/dm.c b/dm.c
index a48aa72..ff9e8ad 100644
--- a/dm.c
+++ b/dm.c
@@ -342,7 +342,11 @@ dm_known_ioctl(struct tcb *tcp, const unsigned int code,
long arg)
return 1;
}
- tprintf("%s{ve
---
dm.c |4 +++-
tests/ioctl_dm.c | 41 -
2 files changed, 27 insertions(+), 18 deletions(-)
diff --git a/dm.c b/dm.c
index 5c908c9..caffc55 100644
--- a/dm.c
+++ b/dm.c
@@ -327,7 +327,6 @@ dm_known_ioctl(struct tcb *tcp, const unsigned i
---
dm.c | 78 ++
1 file changed, 40 insertions(+), 38 deletions(-)
diff --git a/dm.c b/dm.c
index 73a9b57..814d7d2 100644
--- a/dm.c
+++ b/dm.c
@@ -350,52 +350,54 @@ dm_known_ioctl(struct tcb *tcp, const unsigned int code,
long a
---
dm.c |1 +
1 file changed, 1 insertion(+)
diff --git a/dm.c b/dm.c
index 289bc0d..5c908c9 100644
--- a/dm.c
+++ b/dm.c
@@ -60,6 +60,7 @@ dm_decode_values(struct tcb *tcp, const unsigned int code,
case DM_DEV_SUSPEND:
if (ioc->flags & DM_SUSPEND_FLAG
---
dm.c | 74 --
tests/ioctl_dm.c | 26 +++
2 files changed, 64 insertions(+), 36 deletions(-)
diff --git a/dm.c b/dm.c
index f23a65d..b6fb11d 100644
--- a/dm.c
+++ b/dm.c
@@ -282,28 +282,62 @@ dm_decode_string(c
Build failed otherwise on RHEL 5.
---
dm.c |3 ++-
tests/ioctl_dm.c |1 +
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/dm.c b/dm.c
index b6fb11d..a11196f 100644
--- a/dm.c
+++ b/dm.c
@@ -2,8 +2,9 @@
#ifdef HAVE_LINUX_DM_IOCTL_H
-# include
+# include
# i
---
dm.c |4 ++--
tests/ioctl_dm.c | 12 ++--
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/dm.c b/dm.c
index 3ee74c3..f23a65d 100644
--- a/dm.c
+++ b/dm.c
@@ -288,8 +288,8 @@ dm_known_ioctl(struct tcb *tcp, const unsigned int code,
long arg)
i
---
dm.c |7 ---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/dm.c b/dm.c
index a11196f..73a9b57 100644
--- a/dm.c
+++ b/dm.c
@@ -335,6 +335,10 @@ dm_known_ioctl(struct tcb *tcp, const unsigned int code,
long arg)
goto skip;
}
+ dm_decode_d
---
dm.c |8 +++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/dm.c b/dm.c
index 814d7d2..289bc0d 100644
--- a/dm.c
+++ b/dm.c
@@ -293,7 +293,8 @@ dm_known_ioctl(struct tcb *tcp, const unsigned int code,
long arg)
if (!ioc)
return 0;
- if (u
---
dm.c |2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dm.c b/dm.c
index adfa97e..3ee74c3 100644
--- a/dm.c
+++ b/dm.c
@@ -286,7 +286,7 @@ dm_known_ioctl(struct tcb *tcp, const unsigned int code,
long arg)
char *extra = NULL;
uint32_t extra_size = 0;
-
Otherwise build fails on some old distros which lack DM_DATA_OUT_FLAG
and other flags (excerpt from RHEL 5 build log):
[ 66s] dm.c: In function 'dm_known_ioctl':
[ 66s] dm.c:311: error: 'DM_DATA_OUT_FLAG' undeclared (first use in this
function)
[ 66s] dm.c:311: error: (Each undeclared ident
dm.c [!DM_LIST_VERSIONS] (DM_LIST_VERSIONS): New definition.
[!DM_TARGET_MSG] (DM_TARGET_MSG): Likewise.
[!DM_DEV_SET_GEOMETRY] (DM_DEV_SET_GEOMETRY): Likewise.
---
dm.c | 13 +
1 file changed, 13 insertions(+)
diff --git a/dm.c b/dm.c
index 79bb7c7..66b615d 100644
--- a/dm.c
+++ b/
* dm.c: Add check whether DM_VERSION_MAJOR equals to 4, provide empty
dm_ioctl if check fails.
---
dm.c | 13 -
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/dm.c b/dm.c
index ebdfc44..79bb7c7 100644
--- a/dm.c
+++ b/dm.c
@@ -5,6 +5,8 @@
# include
# include
+# i
When building with -Wp,-D_FORTIFY_SOURCE=2, dompiler produces the
following warning:
In file included from /usr/include/string.h:638:0,
from ioctl_dm.c:4:
In function ‘strcpy’,
inlined from ‘main’ at ioctl_dm.c:57:8:
/usr/include/bits/string3.h:104:3: warning: call to __builti
Trying to make it more C-like and in line with common practices
regarding structure printing.
---
dm.c | 21 +
tests/ioctl_dm.c |2 +-
2 files changed, 14 insertions(+), 9 deletions(-)
diff --git a/dm.c b/dm.c
index d81983d..ebdfc44 100644
--- a/dm.c
+++ b/dm
---
dm.c | 87 +++---
1 file changed, 52 insertions(+), 35 deletions(-)
diff --git a/dm.c b/dm.c
index 33a3972..d81983d 100644
--- a/dm.c
+++ b/dm.c
@@ -2,8 +2,8 @@
#ifdef HAVE_LINUX_DM_IOCTL_H
-#include
-#include
+# include
+#
---
tests/ioctl_dm.c | 42 +++---
1 file changed, 35 insertions(+), 7 deletions(-)
diff --git a/tests/ioctl_dm.c b/tests/ioctl_dm.c
index f4c3c8b..a5945ae 100644
--- a/tests/ioctl_dm.c
+++ b/tests/ioctl_dm.c
@@ -40,38 +40,66 @@ main(void)
s.ioc.data_s
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 de
22 matches
Mail list logo