[CRIU] [PATCH] files: Enhance error message

Cyrill Gorcunov gorcunov at openvz.org
Thu Jul 26 18:06:34 EDT 2012


While being debugging problem I found plain
BUG_ON is not enough.

Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
---
 files.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/files.c b/files.c
index f5b6d6b..1e88149 100644
--- a/files.c
+++ b/files.c
@@ -81,7 +81,11 @@ static inline struct file_desc *find_file_desc(FdinfoEntry *fe)
 
 struct fdinfo_list_entry *file_master(struct file_desc *d)
 {
-	BUG_ON(list_empty(&d->fd_info_head));
+	if (list_empty(&d->fd_info_head)) {
+		pr_err("Empty list on file desc id %#x\n", d->id);
+		BUG_ON(1);
+	}
+
 	return list_first_entry(&d->fd_info_head,
 			struct fdinfo_list_entry, desc_list);
 }
-- 
1.7.7.6



More information about the CRIU mailing list