Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1287112

Re: [PATCH 1/2] null_blk: Remove null block from list in error path

From Minfei Huang <mhuang@redhat.com>
Newsgroups linux.kernel
Subject Re: [PATCH 1/2] null_blk: Remove null block from list in error path
Date 2015-12-09 06:20 +0100
Message-ID <qDFku-3Y0-7@gated-at.bofh.it> (permalink)
References <qzrg5-3nT-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Ping.

Any comment is appreciate.

Thanks
Minfei

On 11/27/15 at 09:26pm, Minfei Huang wrote:
> To make consistent of null block list, we should remove enqueued null
> block from the list before freeing it.
> 
> Signed-off-by: Minfei Huang <mnfhuang@gmail.com>
> ---
>  drivers/block/null_blk.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/block/null_blk.c b/drivers/block/null_blk.c
> index ec99568..729ecd7 100644
> --- a/drivers/block/null_blk.c
> +++ b/drivers/block/null_blk.c
> @@ -738,7 +738,7 @@ static int null_add_dev(void)
>  		rv = nvm_register(nullb->q, nullb->disk_name,
>  							&null_lnvm_dev_ops);
>  		if (rv)
> -			goto out_cleanup_blk_queue;
> +			goto out_cleanup_blk_list;
>  		goto done;
>  	}
>  
> @@ -765,6 +765,10 @@ done:
>  out_cleanup_lightnvm:
>  	if (use_lightnvm)
>  		nvm_unregister(nullb->disk_name);
> +out_cleanup_blk_list:
> +	mutex_lock(&lock);
> +	list_del_init(&nullb->list);
> +	mutex_unlock(&lock);
>  out_cleanup_blk_queue:
>  	blk_cleanup_queue(nullb->q);
>  out_cleanup_tags:
> -- 
> 1.8.3.1
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Re: [PATCH 1/2] null_blk: Remove null block from list in error path Minfei Huang <mhuang@redhat.com> - 2015-12-09 06:20 +0100
  Re: [PATCH 1/2] null_blk: Remove null block from list in error path Matias Bjørling <m@bjorling.me> - 2015-12-09 09:20 +0100

csiph-web