[CRIU] [crtools-bot for Pavel Emelyanov ] dump: Stop scanning at once if list is empty

Cyrill Gorcunov gorcunov at openvz.org
Thu Mar 1 10:31:21 EST 2012


The commit is pushed to "master" and will appear on git://github.com/cyrillos/crtools.git
------>
commit 1e98f53cca61ab8919e024248c52455c3fc58015
Author: Pavel Emelyanov <xemul at parallels.com>
Date:   Thu Mar 1 19:13:34 2012 +0400

    dump: Stop scanning at once if list is empty
    
    Empty list on scan error means, that the very top task ran away from
    us. There's no point in trying to catch one.
    
    Signed-off-by: Pavel Emelyanov <xemul at parallels.com>
    Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
---
 cr-dump.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/cr-dump.c b/cr-dump.c
index c5b2eef..defe3a3 100644
--- a/cr-dump.c
+++ b/cr-dump.c
@@ -1036,6 +1036,12 @@ static int collect_pstree(pid_t pid, struct list_head *pstree_list,
 			break;
 		}
 
+		if (list_empty(pstree_list))
+			/*
+			 * No items at all -- no need in re-scanning it again
+			 */
+			break;
+
 		/*
 		 * Old tasks can die and new ones can appear while we
 		 * try to seize the swarm. It's much simpler (and reliable)


More information about the CRIU mailing list