[prev in list] [next in list] [prev in thread] [next in thread]
List: openvz-criu
Subject: [CRIU] [PATCH] dump: Don't allocate dfds in case we dump shared fdtable
From: xemul () parallels ! com (Pavel Emelyanov)
Date: 2014-08-27 9:10:13
Message-ID: 53FDA075.2040101 () parallels ! com
[Download RAW message or body]
After patches, that dump locks w/o dfds array, we can even
not allocate one when we don't need it.
Signed-off-by: Pavel Emelyanov <xemul at parallels.com>
---
cr-dump.c | 18 ++++++++++--------
1 file changed, 10 insertions(+), 8 deletions(-)
diff --git a/cr-dump.c b/cr-dump.c
index 8abb142..4b9fc9f 100644
--- a/cr-dump.c
+++ b/cr-dump.c
@@ -1516,14 +1516,16 @@ static int dump_one_task(struct pstree_item *item)
goto err;
}
- dfds = xmalloc(sizeof(*dfds));
- if (!dfds)
- goto err;
+ if (!shared_fdtable(item)) {
+ dfds = xmalloc(sizeof(*dfds));
+ if (!dfds)
+ goto err;
- ret = collect_fds(pid, dfds);
- if (ret) {
- pr_err("Collect fds (pid: %d) failed with %d\n", pid, ret);
- goto err;
+ ret = collect_fds(pid, dfds);
+ if (ret) {
+ pr_err("Collect fds (pid: %d) failed with %d\n", pid, ret);
+ goto err;
+ }
}
ret = parse_posix_timers(pid, &proc_args);
@@ -1597,7 +1599,7 @@ static int dump_one_task(struct pstree_item *item)
goto err_cure;
}
- if (!shared_fdtable(item)) {
+ if (dfds) {
ret = dump_task_files_seized(parasite_ctl, item, dfds);
if (ret) {
pr_err("Dump files (pid: %d) failed with %d\n", pid, ret);
--
1.8.4.2
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic