Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753446AbdCBOOB (ORCPT ); Thu, 2 Mar 2017 09:14:01 -0500 Received: from server.coly.li ([162.144.45.48]:37952 "EHLO server.coly.li" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752940AbdCBONx (ORCPT ); Thu, 2 Mar 2017 09:13:53 -0500 Subject: Re: [PATCH] bcache: Fix bcache device names To: Stefan Bader , linux-bcache@vger.kernel.org References: <1488453115-17245-1-git-send-email-stefan.bader@canonical.com> Cc: linux-kernel@vger.kernel.org, Eric Wheeler From: Coly Li Message-ID: Date: Thu, 2 Mar 2017 22:11:23 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:45.0) Gecko/20100101 Thunderbird/45.7.1 MIME-Version: 1.0 In-Reply-To: <1488453115-17245-1-git-send-email-stefan.bader@canonical.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - server.coly.li X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - coly.li X-Get-Message-Sender-Via: server.coly.li: authenticated_id: i@coly.li X-Authenticated-Sender: server.coly.li: i@coly.li X-Source: X-Source-Args: X-Source-Dir: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1185 Lines: 34 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: # v4.10 > Signed-off-by: Stefan Bader Acked-by: Coly Li > --- > 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; >