[CRIU] Re: [PATCH] files: Enhance error message

Pavel Emelyanov xemul at parallels.com
Sat Jul 28 01:11:32 EDT 2012


On 07/27/2012 02:06 AM, Cyrill Gorcunov wrote:
> 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);
>  }

Applied


More information about the CRIU mailing list