Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1591021 > unrolled thread

[PATCH] bcache: Fix bcache device names

Started byStefan Bader <stefan.bader@canonical.com>
First post2017-03-02 13:10 +0100
Last post2017-03-02 15:20 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] bcache: Fix bcache device names Stefan Bader <stefan.bader@canonical.com> - 2017-03-02 13:10 +0100
    Re: [PATCH] bcache: Fix bcache device names Coly Li <i@coly.li> - 2017-03-02 15:20 +0100

#1591021 — [PATCH] bcache: Fix bcache device names

FromStefan Bader <stefan.bader@canonical.com>
Date2017-03-02 13:10 +0100
Subject[PATCH] bcache: Fix bcache device names
Message-ID<tgxIt-26H-3@gated-at.bofh.it>
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>
---
 drivers/md/bcache/super.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c
index 85e3f21..817e155 100644
--- a/drivers/md/bcache/super.c
+++ b/drivers/md/bcache/super.c
@@ -793,7 +793,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;
-- 
2.7.4

[toc] | [next] | [standalone]


#1591120

FromColy Li <i@coly.li>
Date2017-03-02 15:20 +0100
Message-ID<tgzKh-3oK-11@gated-at.bofh.it>
In reply to#1591021
On 2017/3/2 下午7:11, Stefan Bader wrote:
> 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>

Acked-by: Coly Li <colyli@suse.de>

> ---
>  drivers/md/bcache/super.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c
> index 85e3f21..817e155 100644
> --- a/drivers/md/bcache/super.c
> +++ b/drivers/md/bcache/super.c
> @@ -793,7 +793,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;
> 

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web