]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commitdiff
bcache: unregister reboot notifier if bcache fails to unregister device
authorZheng Liu <wenqing.lz@taobao.com>
Mon, 30 Nov 2015 01:21:57 +0000 (17:21 -0800)
committerTim Gardner <tim.gardner@canonical.com>
Wed, 6 Apr 2016 09:22:24 +0000 (10:22 +0100)
BugLink: http://bugs.launchpad.net/bugs/1553179
commit 2ecf0cdb2b437402110ab57546e02abfa68a716b 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: Zheng Liu <wenqing.lz@taobao.com>
Tested-by: Joshua Schmid <jschmid@suse.com>
Tested-by: Eric Wheeler <bcache@linux.ewheeler.net>
Cc: Kent Overstreet <kmo@daterainc.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
drivers/md/bcache/super.c

index 03aa54969346677ab7425a078e8a2784568e9973..acb6724f34a40ef4e16345da5c6faf336c80d431 100644 (file)
@@ -2071,8 +2071,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)) ||