[PATCH] Add check for empty aio ring in vma mapping
Nikolay Plotnik
nikolay.plotnik at phystech.edu
Fri Aug 15 03:59:54 PDT 2014
Some applications like mysql database use native linux aio with mappings
for aio ring.
This patch checks if process with such mappings can be safety migrated(in
case of empty
aio ring).
Signed-off-by: Nikolay S. Plotnik <nikolay.plotnik at phystech.edu>
---
cr-dump.c | 9 +++++++++
include/image.h | 2 ++
include/parasite-syscall.h | 1 +
include/parasite.h | 6 ++++++
parasite-syscall.c | 20 +++++++++++++++++++
pie/parasite.c | 49
++++++++++++++++++++++++++++++++++++++++++++++
proc_parse.c | 4 ++++
7 files changed, 91 insertions(+)
diff --git a/cr-dump.c b/cr-dump.c
index 1700d9d..e8eee6b 100644
--- a/cr-dump.c
+++ b/cr-dump.c
@@ -102,6 +102,9 @@ bool privately_dump_vma(struct vma_area *vma)
if (vma_area_is(vma, VMA_ANON_SHARED))
return false;
+ if(vma_area_is(vma, VMA_AREA_AIO))
+ return false;
+
if (!vma_area_is(vma, VMA_ANON_PRIVATE) &&
!vma_area_is(vma, VMA_FILE_PRIVATE)) {
pr_warn("Unexpected VMA area found\n");
@@ -1410,6 +1413,12 @@ static int pre_dump_one_task(struct pstree_item
*item, struct list_head *ctls)
goto err_cure;
}
+ ret = parasite_dump_aio_ring(parasite_ctl, &vmas);
+ if(ret) {
+ pr_err("Can't dump aio ring (pid: %d)\n", pid);
+ goto err_cure;
+ }
+
ret = predump_task_files(pid);
if (ret) {
pr_err("Pre-dumping files failed (pid: %d)\n", pid);
diff --git a/include/image.h b/include/image.h
index 477f339..8399e85 100644
--- a/include/image.h
+++ b/include/image.h
@@ -53,6 +53,8 @@
#define VMA_AREA_SOCKET (1 << 11)
#define VMA_AREA_VVAR (1 << 12)
+#define VMA_AREA_AIO (1 << 13)
+
#define VMA_UNSUPP (1 << 31) /* Unsupported VMA */
#define CR_CAP_SIZE 2
diff --git a/include/parasite-syscall.h b/include/parasite-syscall.h
index 71534da..338dacd 100644
--- a/include/parasite-syscall.h
+++ b/include/parasite-syscall.h
@@ -83,6 +83,7 @@ extern int __parasite_wait_daemon_ack(unsigned int cmd,
struct parasite_ctl *ctl);
extern int parasite_dump_misc_seized(struct parasite_ctl *ctl, struct
parasite_dump_misc *misc);
+extern int parasite_dump_aio_ring(struct parasite_ctl *ctl, struct
vm_area_list *vma_area_list);
extern int parasite_dump_creds(struct parasite_ctl *ctl, struct
_CredsEntry *ce);
extern int parasite_dump_thread_seized(struct parasite_ctl *ctl, int id,
struct pid *tid, struct _CoreEntry *core);
diff --git a/include/parasite.h b/include/parasite.h
index eaabc01..40f7bff 100644
--- a/include/parasite.h
+++ b/include/parasite.h
@@ -42,6 +42,7 @@ enum {
PARASITE_CMD_DUMP_ITIMERS,
PARASITE_CMD_DUMP_POSIX_TIMERS,
PARASITE_CMD_DUMP_MISC,
+ PARASITE_CMD_DUMP_AIO_RING,
PARASITE_CMD_DUMP_CREDS,
PARASITE_CMD_DRAIN_FDS,
PARASITE_CMD_GET_PROC_FD,
@@ -162,6 +163,11 @@ struct parasite_dump_misc {
int dumpable;
};
+struct parasite_dump_aio_ring {
+ unsigned long start;
+ unsigned long len;
+};
+
#define PARASITE_MAX_GROUPS (PAGE_SIZE / sizeof(unsigned int) - 2 *
sizeof(unsigned))
struct parasite_dump_creds {
diff --git a/parasite-syscall.c b/parasite-syscall.c
index f26503a..2d0352e 100644
--- a/parasite-syscall.c
+++ b/parasite-syscall.c
@@ -718,6 +718,26 @@ int parasite_dump_misc_seized(struct parasite_ctl
*ctl, struct parasite_dump_mis
return 0;
}
+int parasite_dump_aio_ring(struct parasite_ctl *ctl, struct vm_area_list
*vma_area_list)
+{
+ struct parasite_dump_aio_ring *args;
+ struct vma_area *vma;
+
+ args = parasite_args(ctl, struct parasite_dump_aio_ring);
+
+ list_for_each_entry(vma, &vma_area_list->h, list) {
+ if (vma_area_is(vma, VMA_AREA_REGULAR) && vma_area_is(vma, VMA_AREA_AIO))
{
+ args->start = vma->e->start;
+ args->len = vma_area_len(vma);
+ if (parasite_execute_daemon(PARASITE_CMD_DUMP_AIO_RING, ctl) < 0) {
+ pr_err("aio: Failed to dump aio ring");
+ return -1;
+ }
+ }
+ }
+ return 0;
+}
+
struct parasite_tty_args *parasite_dump_tty(struct parasite_ctl *ctl, int
fd)
{
struct parasite_tty_args *p;
diff --git a/pie/parasite.c b/pie/parasite.c
index 92e7708..11a5c86 100644
--- a/pie/parasite.c
+++ b/pie/parasite.c
@@ -175,6 +175,50 @@ static int dump_misc(struct parasite_dump_misc *args)
return dump_thread_common(&args->ti);
}
+struct aio_ring {
+ unsigned id; /* kernel internal index number */
+ unsigned nr; /* number of io_events */
+ unsigned head; /* Written to by userland or under
ring_lock
+ * mutex by aio_read_events_ring(). */
+ unsigned tail;
+
+ unsigned magic;
+ unsigned compat_features;
+ unsigned incompat_features;
+ unsigned header_length; /* size of aio_ring */
+
+
+ void *io_events;
+};
+
+#define AIO_RING_MAGIC 0xa10a10a1
+
+static int dump_aio_ring(struct parasite_dump_aio_ring *args)
+{
+ struct aio_ring *ar = 0;
+
+ if(sizeof(struct aio_ring) > args->len) {
+ pr_err("Size of struct aio_ring is greater than given vma area size\n");
+ return -1;
+ }
+
+ ar = (struct aio_ring *)args->start;
+
+ if(AIO_RING_MAGIC != ar->magic) {
+ pr_err("Wrong magic number in aio structure, value - %x\n", ar->magic);
+ return -1;
+ }
+
+ if(ar->nr != 0) {
+ pr_err("Non empty aio ring, %x events\n", ar->nr);
+ return -1;
+ }
+
+ pr_info("aio ring is empty\n");
+
+ return 0;
+}
+
static int dump_creds(struct parasite_dump_creds *args)
{
int ret;
@@ -470,6 +514,9 @@ static noinline __used int noinline
parasite_daemon(void *args)
case PARASITE_CMD_DUMP_MISC:
ret = dump_misc(args);
break;
+ case PARASITE_CMD_DUMP_AIO_RING:
+ ret = dump_aio_ring(args);
+ break;
case PARASITE_CMD_DUMP_CREDS:
ret = dump_creds(args);
break;
@@ -539,6 +586,8 @@ static noinline __used int parasite_init_daemon(void
*data)
if (ret < 0) {
pr_err("Can't connect the control socket\n");
goto err;
+
+
}
ret = recv_fd(tsock);
diff --git a/proc_parse.c b/proc_parse.c
index 271d46b..9f38916 100644
--- a/proc_parse.c
+++ b/proc_parse.c
@@ -428,6 +428,8 @@ int parse_smaps(pid_t pid, struct vm_area_list
*vma_area_list, bool use_map_file
#endif
} else if (strstr(buf, "[heap]")) {
vma_area->e->status |= VMA_AREA_REGULAR | VMA_AREA_HEAP;
+ } else if (strstr(buf, "/[aio]")) {
+ vma_area->e->status |= VMA_AREA_REGULAR | VMA_AREA_AIO;
} else {
vma_area->e->status = VMA_AREA_REGULAR;
}
@@ -436,6 +438,8 @@ int parse_smaps(pid_t pid, struct vm_area_list
*vma_area_list, bool use_map_file
* Some mapping hints for restore, we save this on
* disk and restore might need to analyze it.
*/
+ if(vma_area_is(vma_area, VMA_AREA_AIO))
+ continue;
if (vma_area->file_borrowed) {
struct vma_area *prev = prev_vfi.vma;
--
1.9.3
--089e01494c286314850500ab4a5c
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div>From eb561addda9a216ab8875354c6f14d7741ee898f Mon Sep=
17 00:00:00 2001</div><div>From: Nikolay Plotnik <<a href=3D"mailto:nik=
olay.plotnik at phystech.edu">nikolay.plotnik at phystech.edu</a>></div><div>D=
ate: Fri, 15 Aug 2014 14:59:54 +0400</div>
<div>Subject: [PATCH] Add check for empty aio ring in vma mapping</div><div=
><br></div><div>Some applications like mysql database use native linux aio =
with mappings for aio ring.</div><div>This patch checks if process with suc=
h mappings can be safety migrated(in case of empty</div>
<div>aio ring).</div><div><br></div><div>Signed-off-by: Nikolay S. Plotnik =
<<a href=3D"mailto:nikolay.plotnik at phystech.edu">nikolay.plotnik at phystec=
h.edu</a>></div><div><br></div><div>---</div><div>=C2=A0cr-dump.c =C2=A0=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0| =C2=A09 +++++++++=
</div>
<div>=C2=A0include/image.h =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0| =C2=
=A02 ++</div><div>=C2=A0include/parasite-syscall.h | =C2=A01 +</div><div>=
=C2=A0include/parasite.h =C2=A0 =C2=A0 =C2=A0 =C2=A0 | =C2=A06 ++++++</div>=
<div>=C2=A0parasite-syscall.c =C2=A0 =C2=A0 =C2=A0 =C2=A0 | 20 ++++++++++++=
+++++++</div><div>=C2=A0pie/parasite.c =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 | 49 ++++++++++++++++++++++++++++++++++++++++++++++</div>
<div>=C2=A0proc_parse.c =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 | =
=C2=A04 ++++</div><div>=C2=A07 files changed, 91 insertions(+)</div><div><b=
r></div><div>diff --git a/cr-dump.c b/cr-dump.c</div><div>index 1700d9d..e8=
eee6b 100644</div><div>--- a/cr-dump.c</div><div>
+++ b/cr-dump.c</div><div>@@ -102,6 +102,9 @@ bool privately_dump_vma(struc=
t vma_area *vma)</div><div>=C2=A0<span class=3D"" style=3D"white-space:pre"=
> </span>if (vma_area_is(vma, VMA_ANON_SHARED))</div><div>=C2=A0<span class=
=3D"" style=3D"white-space:pre"> </span>return false;</div>
<div>=C2=A0</div><div>+<span class=3D"" style=3D"white-space:pre"> </span>i=
f(vma_area_is(vma, VMA_AREA_AIO))</div><div>+<span class=3D"" style=3D"whit=
e-space:pre"> </span>return false;</div><div>+</div><div>=C2=A0<span class=
=3D"" style=3D"white-space:pre"> </span>if (!vma_area_is(vma, VMA_ANON_PRIV=
ATE) &&</div>
<div>=C2=A0<span class=3D"" style=3D"white-space:pre"> </span>!vma_area_i=
s(vma, VMA_FILE_PRIVATE)) {</div><div>=C2=A0<span class=3D"" style=3D"white=
-space:pre"> </span>pr_warn("Unexpected VMA area found\n");</div=
><div>@@ -1410,6 +1413,12 @@ static int pre_dump_one_task(struct pstree_ite=
m *item, struct list_head *ctls)</div>
<div>=C2=A0<span class=3D"" style=3D"white-space:pre"> </span>goto err_cur=
e;</div><div>=C2=A0<span class=3D"" style=3D"white-space:pre"> </span>}</di=
v><div>=C2=A0</div><div>+<span class=3D"" style=3D"white-space:pre"> </span=
>ret =3D parasite_dump_aio_ring(parasite_ctl, &vmas);</div>
<div>+<span class=3D"" style=3D"white-space:pre"> </span>if(ret) {</div><di=
v>+<span class=3D"" style=3D"white-space:pre"> </span>pr_err("Can'=
;t dump aio ring (pid: %d)\n", pid);</div><div>+<span class=3D"" style=
=3D"white-space:pre"> </span>goto err_cure;</div>
<div>+<span class=3D"" style=3D"white-space:pre"> </span>}</div><div>+</div=
><div>=C2=A0<span class=3D"" style=3D"white-space:pre"> </span>ret =3D pred=
ump_task_files(pid);</div><div>=C2=A0<span class=3D"" style=3D"white-space:=
pre"> </span>if (ret) {</div>
<div>=C2=A0<span class=3D"" style=3D"white-space:pre"> </span>pr_err("=
;Pre-dumping files failed (pid: %d)\n", pid);</div><div>diff --git a/i=
nclude/image.h b/include/image.h</div><div>index 477f339..8399e85 100644</d=
iv><div>
--- a/include/image.h</div><div>+++ b/include/image.h</div><div>@@ -53,6 +5=
3,8 @@</div><div>=C2=A0#define VMA_AREA_SOCKET<span class=3D"" style=3D"whi=
te-space:pre"> </span>(1 << =C2=A011)</div><div>=C2=A0#define VMA_AR=
EA_VVAR<span class=3D"" style=3D"white-space:pre"> </span>(1 << =C2=
=A012)</div>
<div>=C2=A0</div><div>+#define VMA_AREA_AIO<span class=3D"" style=3D"white-=
space:pre"> </span>(1 << =C2=A013)</div><div>+</div><div>=C2=A0#defi=
ne VMA_UNSUPP<span class=3D"" style=3D"white-space:pre"> </span>(1 <<=
; =C2=A031)<span class=3D"" style=3D"white-space:pre"> </span>/* Unsupporte=
d VMA */</div>
<div>=C2=A0</div><div>=C2=A0#define CR_CAP_SIZE<span class=3D"" style=3D"wh=
ite-space:pre"> </span>2</div><div>diff --git a/include/parasite-syscall.h =
b/include/parasite-syscall.h</div><div>index 71534da..338dacd 100644</div><=
div>--- a/include/parasite-syscall.h</div>
<div>+++ b/include/parasite-syscall.h</div><div>@@ -83,6 +83,7 @@ extern in=
t __parasite_wait_daemon_ack(unsigned int cmd,</div><div>=C2=A0<span class=
=3D"" style=3D"white-space:pre"> </span> =C2=A0 =C2=A0 =C2=A0struct par=
asite_ctl *ctl);</div>
<div>=C2=A0</div><div>=C2=A0extern int parasite_dump_misc_seized(struct par=
asite_ctl *ctl, struct parasite_dump_misc *misc);</div><div>+extern int par=
asite_dump_aio_ring(struct parasite_ctl *ctl, struct vm_area_list *vma_area=
_list);</div>
<div>=C2=A0extern int parasite_dump_creds(struct parasite_ctl *ctl, struct =
_CredsEntry *ce);</div><div>=C2=A0extern int parasite_dump_thread_seized(st=
ruct parasite_ctl *ctl, int id,</div><div>=C2=A0<span class=3D"" style=3D"w=
hite-space:pre"> </span>struct pid *tid, struct _CoreEntry *core);</div=
>
<div>diff --git a/include/parasite.h b/include/parasite.h</div><div>index e=
aabc01..40f7bff 100644</div><div>--- a/include/parasite.h</div><div>+++ b/i=
nclude/parasite.h</div><div>@@ -42,6 +42,7 @@ enum {</div><div>=C2=A0<span =
class=3D"" style=3D"white-space:pre"> </span>PARASITE_CMD_DUMP_ITIMERS,</di=
v>
<div>=C2=A0<span class=3D"" style=3D"white-space:pre"> </span>PARASITE_CMD_=
DUMP_POSIX_TIMERS,</div><div>=C2=A0<span class=3D"" style=3D"white-space:pr=
e"> </span>PARASITE_CMD_DUMP_MISC,</div><div>+<span class=3D"" style=3D"whi=
te-space:pre"> </span>PARASITE_CMD_DUMP_AIO_RING,</div>
<div>=C2=A0<span class=3D"" style=3D"white-space:pre"> </span>PARASITE_CMD_=
DUMP_CREDS,</div><div>=C2=A0<span class=3D"" style=3D"white-space:pre"> </s=
pan>PARASITE_CMD_DRAIN_FDS,</div><div>=C2=A0<span class=3D"" style=3D"white=
-space:pre"> </span>PARASITE_CMD_GET_PROC_FD,</div>
<div>@@ -162,6 +163,11 @@ struct parasite_dump_misc {</div><div>=C2=A0<span=
class=3D"" style=3D"white-space:pre"> </span>int dumpable;</div><div>=C2=
=A0};</div><div>=C2=A0</div><div>+struct parasite_dump_aio_ring {</div><div=
>+<span class=3D"" style=3D"white-space:pre"> </span>unsigned long =C2=A0 s=
tart;</div>
<div>+<span class=3D"" style=3D"white-space:pre"> </span>unsigned long =C2=
=A0 len;</div><div>+};</div><div>+</div><div>=C2=A0#define PARASITE_MAX_GRO=
UPS<span class=3D"" style=3D"white-space:pre"> </span>(PAGE_SIZE / sizeof(u=
nsigned int) - 2 * sizeof(unsigned))</div>
<div>=C2=A0</div><div>=C2=A0struct parasite_dump_creds {</div><div>diff --g=
it a/parasite-syscall.c b/parasite-syscall.c</div><div>index f26503a..2d035=
2e 100644</div><div>--- a/parasite-syscall.c</div><div>+++ b/parasite-sysca=
ll.c</div>
<div>@@ -718,6 +718,26 @@ int parasite_dump_misc_seized(struct parasite_ctl=
*ctl, struct parasite_dump_mis</div><div>=C2=A0<span class=3D"" style=3D"w=
hite-space:pre"> </span>return 0;</div><div>=C2=A0}</div><div>=C2=A0</div><=
div>+int parasite_dump_aio_ring(struct parasite_ctl *ctl, struct vm_area_li=
st *vma_area_list)</div>
<div>+{</div><div>+<span class=3D"" style=3D"white-space:pre"> </span>struc=
t parasite_dump_aio_ring *args;</div><div>+<span class=3D"" style=3D"white-=
space:pre"> </span>struct vma_area *vma;</div><div>+</div><div>+<span class=
=3D"" style=3D"white-space:pre"> </span>args =3D parasite_args(ctl, struct =
parasite_dump_aio_ring);</div>
<div>+</div><div>+<span class=3D"" style=3D"white-space:pre"> </span>list_f=
or_each_entry(vma, &vma_area_list->h, list) {</div><div>+<span class=
=3D"" style=3D"white-space:pre"> </span>if (vma_area_is(vma, VMA_AREA_REGU=
LAR) && vma_area_is(vma, VMA_AREA_AIO)) {</div>
<div>+<span class=3D"" style=3D"white-space:pre"> </span>args->start =
=3D vma->e->start;</div><div>+<span class=3D"" style=3D"white-space:p=
re"> </span> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0args-&g=
t;len =3D vma_area_len(vma);</div><div>+<span class=3D"" style=3D"white-spa=
ce:pre"> </span>if (parasite_execute_daemon(PARASITE_CMD_DUMP_AIO_RING, c=
tl) < 0) {</div>
<div>+<span class=3D"" style=3D"white-space:pre"> </span>pr_err("ai=
o: Failed to dump aio ring");</div><div>+<span class=3D"" style=3D"whi=
te-space:pre"> </span>return -1;</div><div>+<span class=3D"" style=3D"wh=
ite-space:pre"> </span>}</div>
<div>+<span class=3D"" style=3D"white-space:pre"> </span>}</div><div>+<spa=
n class=3D"" style=3D"white-space:pre"> </span>}</div><div>+<span class=3D"=
" style=3D"white-space:pre"> </span>return 0;</div><div>+}</div><div>+</div=
><div>=C2=A0struct parasite_tty_args *parasite_dump_tty(struct parasite_ctl=
*ctl, int fd)</div>
<div>=C2=A0{</div><div>=C2=A0<span class=3D"" style=3D"white-space:pre"> </=
span>struct parasite_tty_args *p;</div><div>diff --git a/pie/parasite.c b/p=
ie/parasite.c</div><div>index 92e7708..11a5c86 100644</div><div>--- a/pie/p=
arasite.c</div>
<div>+++ b/pie/parasite.c</div><div>@@ -175,6 +175,50 @@ static int dump_mi=
sc(struct parasite_dump_misc *args)</div><div>=C2=A0<span class=3D"" style=
=3D"white-space:pre"> </span>return dump_thread_common(&args->ti);</=
div><div>
=C2=A0}</div><div>=C2=A0</div><div>+struct aio_ring {</div><div>+ =C2=A0 =
=C2=A0 =C2=A0 =C2=A0unsigned =C2=A0 =C2=A0 =C2=A0 =C2=A0id; =C2=A0 =C2=A0 /=
* kernel internal index number */</div><div>+ =C2=A0 =C2=A0 =C2=A0 =C2=A0un=
signed =C2=A0 =C2=A0 =C2=A0 =C2=A0nr; =C2=A0 =C2=A0 /* number of io_events =
*/</div><div>+ =C2=A0 =C2=A0 =C2=A0 =C2=A0unsigned =C2=A0 =C2=A0 =C2=A0 =C2=
=A0head; =C2=A0 /* Written to by userland or under ring_lock</div>
<div>+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 * mutex by aio_read_events_ri=
ng(). */</div><div>+ =C2=A0 =C2=A0 =C2=A0 =C2=A0unsigned =C2=A0 =C2=A0 =C2=
=A0 =C2=A0tail;</div><div>+</div><div>+ =C2=A0 =C2=A0 =C2=A0 =C2=A0unsigned=
=C2=A0 =C2=A0 =C2=A0 =C2=A0magic;</div><div>+ =C2=A0 =C2=A0 =C2=A0 =C2=A0u=
nsigned =C2=A0 =C2=A0 =C2=A0 =C2=A0compat_features;</div>
<div>+ =C2=A0 =C2=A0 =C2=A0 =C2=A0unsigned =C2=A0 =C2=A0 =C2=A0 =C2=A0incom=
pat_features;</div><div>+ =C2=A0 =C2=A0 =C2=A0 =C2=A0unsigned =C2=A0 =C2=A0=
=C2=A0 =C2=A0header_length; =C2=A0/* size of aio_ring */</div><div>+</div>=
<div>+</div><div>+ =C2=A0 =C2=A0 =C2=A0 =C2=A0void =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0*io_events;</div><div>+};</div><div>+</div>
<div>+#define AIO_RING_MAGIC =C2=A00xa10a10a1</div><div>+</div><div>+static=
int dump_aio_ring(struct parasite_dump_aio_ring *args)</div><div>+{</div><=
div>+<span class=3D"" style=3D"white-space:pre"> </span>struct aio_ring =C2=
=A0*ar =3D 0;</div>
<div>+</div><div>+<span class=3D"" style=3D"white-space:pre"> </span>if(siz=
eof(struct aio_ring) > args->len) {</div><div>+<span class=3D"" style=
=3D"white-space:pre"> </span>pr_err("Size of struct aio_ring is great=
er than given vma area size\n");</div>
<div>+<span class=3D"" style=3D"white-space:pre"> </span>return -1;</div><=
div>+<span class=3D"" style=3D"white-space:pre"> </span>}</div><div>+</div>=
<div>+<span class=3D"" style=3D"white-space:pre"> </span>ar =3D (struct aio=
_ring *)args->start;</div>
<div>+</div><div>+<span class=3D"" style=3D"white-space:pre"> </span>if(AIO=
_RING_MAGIC !=3D ar->magic) {</div><div>+<span class=3D"" style=3D"white=
-space:pre"> </span>pr_err("Wrong magic number in aio structure, valu=
e - %x\n", ar->magic);</div>
<div>+<span class=3D"" style=3D"white-space:pre"> </span>return -1;</div><=
div>+<span class=3D"" style=3D"white-space:pre"> </span>}</div><div>+</div>=
<div>+<span class=3D"" style=3D"white-space:pre"> </span>if(ar->nr !=3D =
0) {</div>
<div>+<span class=3D"" style=3D"white-space:pre"> </span>pr_err("Non =
empty aio ring, %x events\n", ar->nr);</div><div>+<span class=3D"" =
style=3D"white-space:pre"> </span>return -1;</div><div>+<span class=3D"" s=
tyle=3D"white-space:pre"> </span>}</div>
<div>+</div><div>+<span class=3D"" style=3D"white-space:pre"> </span>pr_inf=
o("aio ring is empty\n");</div><div>+</div><div>+<span class=3D""=
style=3D"white-space:pre"> </span>return 0;</div><div>+}</div><div>+</div>=
<div>
=C2=A0static int dump_creds(struct parasite_dump_creds *args)</div><div>=C2=
=A0{</div><div>=C2=A0<span class=3D"" style=3D"white-space:pre"> </span>int=
ret;</div><div>@@ -470,6 +514,9 @@ static noinline __used int noinline par=
asite_daemon(void *args)</div>
<div>=C2=A0<span class=3D"" style=3D"white-space:pre"> </span>case PARASIT=
E_CMD_DUMP_MISC:</div><div>=C2=A0<span class=3D"" style=3D"white-space:pre"=
> </span>ret =3D dump_misc(args);</div><div>=C2=A0<span class=3D"" style=
=3D"white-space:pre"> </span>break;</div>
<div>+<span class=3D"" style=3D"white-space:pre"> </span>case PARASITE_CMD=
_DUMP_AIO_RING:</div><div>+<span class=3D"" style=3D"white-space:pre"> </=
span>ret =3D dump_aio_ring(args);</div><div>+<span class=3D"" style=3D"whit=
e-space:pre"> </span>break;</div>
<div>=C2=A0<span class=3D"" style=3D"white-space:pre"> </span>case PARASIT=
E_CMD_DUMP_CREDS:</div><div>=C2=A0<span class=3D"" style=3D"white-space:pre=
"> </span>ret =3D dump_creds(args);</div><div>=C2=A0<span class=3D"" styl=
e=3D"white-space:pre"> </span>break;</div>
<div>@@ -539,6 +586,8 @@ static noinline __used int parasite_init_daemon(vo=
id *data)</div><div>=C2=A0<span class=3D"" style=3D"white-space:pre"> </spa=
n>if (ret < 0) {</div><div>=C2=A0<span class=3D"" style=3D"white-space:p=
re"> </span>pr_err("Can't connect the control socket\n");</d=
iv>
<div>=C2=A0<span class=3D"" style=3D"white-space:pre"> </span>goto err;</d=
iv><div>+</div><div>+</div><div>=C2=A0<span class=3D"" style=3D"white-space=
:pre"> </span>}</div><div>=C2=A0</div><div>=C2=A0<span class=3D"" style=3D"=
white-space:pre"> </span>ret =3D recv_fd(tsock);</div>
<div>diff --git a/proc_parse.c b/proc_parse.c</div><div>index 271d46b..9f38=
916 100644</div><div>--- a/proc_parse.c</div><div>+++ b/proc_parse.c</div><=
div>@@ -428,6 +428,8 @@ int parse_smaps(pid_t pid, struct vm_area_list *vma=
_area_list, bool use_map_file</div>
<div>=C2=A0#endif</div><div>=C2=A0<span class=3D"" style=3D"white-space:pre=
"> </span>} else if (strstr(buf, "[heap]")) {</div><div>=C2=A0<s=
pan class=3D"" style=3D"white-space:pre"> </span>vma_area->e->statu=
s |=3D VMA_AREA_REGULAR | VMA_AREA_HEAP;</div>
<div>+<span class=3D"" style=3D"white-space:pre"> </span>} else if (strstr=
(buf, "/[aio]")) {</div><div>+<span class=3D"" style=3D"white-spa=
ce:pre"> </span>vma_area->e->status |=3D VMA_AREA_REGULAR | VMA_ARE=
A_AIO;</div>
<div>=C2=A0<span class=3D"" style=3D"white-space:pre"> </span>} else {</di=
v><div>=C2=A0<span class=3D"" style=3D"white-space:pre"> </span>vma_area-=
>e->status =3D VMA_AREA_REGULAR;</div><div>=C2=A0<span class=3D"" sty=
le=3D"white-space:pre"> </span>}</div>
<div>@@ -436,6 +438,8 @@ int parse_smaps(pid_t pid, struct vm_area_list *vm=
a_area_list, bool use_map_file</div><div>=C2=A0<span class=3D"" style=3D"wh=
ite-space:pre"> </span> * Some mapping hints for restore, we save this on<=
/div>
<div>=C2=A0<span class=3D"" style=3D"white-space:pre"> </span> * disk and =
restore might need to analyze it.</div><div>=C2=A0<span class=3D"" style=3D=
"white-space:pre"> </span> */</div><div>+<span class=3D"" style=3D"white-s=
pace:pre"> </span>if(vma_area_is(vma_area, VMA_AREA_AIO))</div>
<div>+<span class=3D"" style=3D"white-space:pre"> </span>continue;</div><=
div>=C2=A0<span class=3D"" style=3D"white-space:pre"> </span>if (vma_area-=
>file_borrowed) {</div><div>=C2=A0<span class=3D"" style=3D"white-space:=
pre"> </span>struct vma_area *prev =3D prev_vfi.vma;</div>
<div>=C2=A0</div><div>--=C2=A0</div><div>1.9.3</div></div>
--089e01494c286314850500ab4a5c--
More information about the CRIU
mailing list