[sheepdog] [PATCH] sheep/vdi: fix coredump when sheep starting up

Hitoshi Mitake mitake.hitoshi at lab.ntt.co.jp
Thu Jul 31 10:02:24 CEST 2014


At Thu, 31 Jul 2014 15:49:46 +0800,
Ruoyu wrote:
> 
> The assertion should be prior to the variable increment.
> 
> Signed-off-by: Ruoyu <liangry at ucweb.com>
> ---
>  sheep/vdi.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Oops, it is my mistake. Applied, thanks.
Hitoshi

> 
> diff --git a/sheep/vdi.c b/sheep/vdi.c
> index dac43cf..433fcd2 100644
> --- a/sheep/vdi.c
> +++ b/sheep/vdi.c
> @@ -237,8 +237,8 @@ static struct vdi_state *fill_vdi_state_list_with_alloc(int *result_nr)
>  		vs[i].lock_state = entry->lock_state.state;
>  		vs[i].lock_owner = entry->lock_state.owner;
>  
> -		i++;
>  		assert(i < nr);
> +		i++;
>  	}
>  
>  	sd_rw_unlock(&vdi_state_lock);
> -- 
> 1.8.3.2
> 
> 
> -- 
> sheepdog mailing list
> sheepdog at lists.wpkg.org
> http://lists.wpkg.org/mailman/listinfo/sheepdog



More information about the sheepdog mailing list