lkml.org 
[lkml]   [2015]   [Nov]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 1/2] null_blk: Remove null block from list in error path
Date
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


\
 
 \ /
  Last update: 2015-11-27 14:41    [W:1.701 / U:0.188 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site