]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
null_blk: add lightnvm null_blk device to the nullb_list
authorWenwei Tao <ww.tao0320@gmail.com>
Fri, 4 Mar 2016 16:27:04 +0000 (00:27 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 11 May 2016 09:21:27 +0000 (11:21 +0200)
commit 3681c85dffda70e551dead31c8d102bd69033fe8 upstream.

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: a514379b0c77 ("null_blk: oops when initializing without lightnvm")
Signed-off-by: Jens Axboe <axboe@fb.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/block/null_blk.c

index 64a7b5971b57046eafd210d726fa039b05bc705d..cab97593ba549e7eb73509f1807546244c057d8e 100644 (file)
@@ -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: