Commit e43ebd52 authored by Zheng Liu's avatar Zheng Liu Committed by Luis Henriques

bcache: unregister reboot notifier if bcache fails to unregister device

commit 2ecf0cdb upstream.

In bcache_init() function it forgot to unregister reboot notifier if
bcache fails to unregister a block device.  This commit fixes this.
Signed-off-by: default avatarZheng Liu <wenqing.lz@taobao.com>
Tested-by: default avatarJoshua Schmid <jschmid@suse.com>
Tested-by: default avatarEric Wheeler <bcache@linux.ewheeler.net>
Cc: Kent Overstreet <kmo@daterainc.com>
Signed-off-by: default avatarJens Axboe <axboe@fb.com>
Signed-off-by: default avatarLuis Henriques <luis.henriques@canonical.com>
parent 459ab78e
......@@ -2087,8 +2087,10 @@ static int __init bcache_init(void)
closure_debug_init();
bcache_major = register_blkdev(0, "bcache");
if (bcache_major < 0)
if (bcache_major < 0) {
unregister_reboot_notifier(&reboot);
return bcache_major;
}
if (!(bcache_wq = create_workqueue("bcache")) ||
!(bcache_kobj = kobject_create_and_add("bcache", fs_kobj)) ||
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment