[CRIU] [PATCH] dump: clean up shared_fdtable

Andrey Vagin avagin at openvz.org
Tue Aug 26 03:19:37 PDT 2014


It's cleaned up accoding with following statements:
* files_id can't be zero (look at dump_task_kobj_ids)
* item->ids is allocated for all non-dead tasks
* a parent can't be dead

In addition here is a tiny coding stype fix.

Fixes: 475bb1e77522 ("rst: Evaluate per-task clone mask early")
Signed-off-by: Andrey Vagin <avagin at openvz.org>
---
 include/pstree.h | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/include/pstree.h b/include/pstree.h
index c361e18..d639cfc 100644
--- a/include/pstree.h
+++ b/include/pstree.h
@@ -32,11 +32,10 @@ struct pstree_item {
 	struct rst_info		rst[0];
 };
 
-static inline int shared_fdtable(struct pstree_item *item) {
-	return (item->parent && item->parent->state != TASK_HELPER &&
-		item->ids &&
-		item->parent->ids &&
-		item->ids->files_id &&
+/* ids is alocated and initialized for all alive tasks */
+static inline int shared_fdtable(struct pstree_item *item)
+{
+	return (item->parent &&
 		item->ids->files_id == item->parent->ids->files_id);
 }
 
-- 
1.9.3



More information about the CRIU mailing list