]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
UBUNTU: SAUCE: bcache: Fix bcache device names
authorStefan Bader <stefan.bader@canonical.com>
Wed, 1 Mar 2017 10:28:07 +0000 (11:28 +0100)
committerSeth Forshee <seth.forshee@canonical.com>
Tue, 5 Sep 2017 12:33:32 +0000 (07:33 -0500)
When adding partition support to bcache, the name assignment was not
updated, resulting in numbers jumping (bcache0, bcache16, bcache32...).
Fix this by taking BCACHE_MINORS into account when assigning the disk
name.

BugLink: https://bugs.launchpad.net/bugs/1667078
Fixes: b8c0d91 (bcache: partition support: add 16 minors per bcacheN device)
Cc: <stable@vger.kernel.org> # v4.10
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
drivers/md/bcache/super.c

index 8352fad765f61991c9725007ecbedff323ddacdb..2b6dfc79ac3f4038bdd82be8a785bf3dfe523dff 100644 (file)
@@ -791,7 +791,8 @@ static int bcache_device_init(struct bcache_device *d, unsigned block_size,
        }
 
        set_capacity(d->disk, sectors);
-       snprintf(d->disk->disk_name, DISK_NAME_LEN, "bcache%i", minor);
+       snprintf(d->disk->disk_name, DISK_NAME_LEN, "bcache%i",
+                minor / BCACHE_MINORS);
 
        d->disk->major          = bcache_major;
        d->disk->first_minor    = minor;