Commit 070720d4 authored by Cyrill Gorcunov's avatar Cyrill Gorcunov Committed by Andrei Vagin

epoll: Pass drained fds to dump_one_file

In epoll dumping we will need the whole set of fds to investigate
the targets, so pass this parameter down to epoll code.
Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
parent 08603fa6
......@@ -475,7 +475,8 @@ static int dump_chrdev(struct fd_parms *p, int lfd, FdinfoEntry *e)
}
static int dump_one_file(struct pid *pid, int fd, int lfd, struct fd_opts *opts,
struct parasite_ctl *ctl, FdinfoEntry *e)
struct parasite_ctl *ctl, FdinfoEntry *e,
struct parasite_drain_fd *dfds)
{
struct fd_parms p = FD_PARMS_INIT;
const struct fdtype_ops *ops;
......@@ -498,6 +499,7 @@ static int dump_one_file(struct pid *pid, int fd, int lfd, struct fd_opts *opts,
}
p.fd_ctl = ctl; /* Some dump_opts require this to talk to parasite */
p.dfds = dfds; /* epoll needs to verify if target fd exist */
if (S_ISSOCK(p.stat.st_mode))
return dump_socket(&p, lfd, e);
......@@ -572,7 +574,7 @@ int dump_my_file(int lfd, u32 *id, int *type)
me.real = getpid();
me.ns[0].virt = -1; /* FIXME */
if (dump_one_file(&me, lfd, lfd, &fo, NULL, &e))
if (dump_one_file(&me, lfd, lfd, &fo, NULL, &e, NULL))
return -1;
*id = e.id;
......@@ -619,7 +621,7 @@ int dump_task_files_seized(struct parasite_ctl *ctl, struct pstree_item *item,
FdinfoEntry e = FDINFO_ENTRY__INIT;
ret = dump_one_file(item->pid, dfds->fds[i + off],
lfds[i], opts + i, ctl, &e);
lfds[i], opts + i, ctl, &e, dfds);
if (ret)
break;
......
......@@ -15,6 +15,7 @@
#include "images/fown.pb-c.h"
#include "images/vma.pb-c.h"
struct parasite_drain_fd;
struct pstree_item;
struct file_desc;
struct cr_imgset;
......@@ -50,6 +51,7 @@ struct fd_parms {
int mnt_id;
struct parasite_ctl *fd_ctl;
struct parasite_drain_fd *dfds;
};
#define FD_PARMS_INIT \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment