Skip to content

Commit

Permalink
null_blk: add lightnvm null_blk device to the nullb_list
Browse files Browse the repository at this point in the history
After register null_blk devices into lightnvm, we forget
to add these devices to the the nullb_list, makes them
invisible to the null_blk driver.

Signed-off-by: Wenwei Tao <ww.tao0320@gmail.com>
Fixes: a514379 ("null_blk: oops when initializing without lightnvm")
Signed-off-by: Jens Axboe <axboe@fb.com>
  • Loading branch information
Wenwei Tao authored and Jens Axboe committed Mar 19, 2016
1 parent 237045f commit 3681c85
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/block/null_blk.c
Original file line number Diff line number Diff line change
Expand Up @@ -742,10 +742,11 @@ static int null_add_dev(void)

add_disk(disk);

done:
mutex_lock(&lock);
list_add_tail(&nullb->list, &nullb_list);
mutex_unlock(&lock);
done:

return 0;

out_cleanup_lightnvm:
Expand Down

0 comments on commit 3681c85

Please sign in to comment.