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


Groups > linux.kernel > #1673316 > unrolled thread

[PATCH] bcache: release the allocated id, not its multiple of BCACHE_MINORS

Started byLiang Chen <liangchen.linux@gmail.com>
First post2017-06-23 09:20 +0200
Last post2017-06-23 13:40 +0200
Articles 4 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] bcache: release the allocated id, not its multiple of BCACHE_MINORS Liang Chen <liangchen.linux@gmail.com> - 2017-06-23 09:20 +0200
    Re: [PATCH] bcache: release the allocated id, not its multiple of  BCACHE_MINORS Coly Li <i@coly.li> - 2017-06-23 10:20 +0200
      Re: [PATCH] bcache: release the allocated id, not its multiple of BCACHE_MINORS Liang Chen <liangchen.linux@gmail.com> - 2017-06-23 13:40 +0200
    Re: [PATCH] bcache: release the allocated id, not its multiple of BCACHE_MINORS Liang Chen <liangchen.linux@gmail.com> - 2017-06-23 13:40 +0200

#1673316 — [PATCH] bcache: release the allocated id, not its multiple of BCACHE_MINORS

FromLiang Chen <liangchen.linux@gmail.com>
Date2017-06-23 09:20 +0200
Subject[PATCH] bcache: release the allocated id, not its multiple of BCACHE_MINORS
Message-ID<tVr2P-7yl-39@gated-at.bofh.it>
The id passed to ida_simple_remove has to be the one originally
allocated with ida_simple_get, not the one after multipling by
BCACHE_MINORS.

Signed-off-by: Liang Chen <liangchen.linux@gmail.com>
---
 drivers/md/bcache/super.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c
index e57353e..9f64477 100644
--- a/drivers/md/bcache/super.c
+++ b/drivers/md/bcache/super.c
@@ -734,7 +734,8 @@ static void bcache_device_free(struct bcache_device *d)
 	if (d->disk && d->disk->queue)
 		blk_cleanup_queue(d->disk->queue);
 	if (d->disk) {
-		ida_simple_remove(&bcache_minor, d->disk->first_minor);
+		ida_simple_remove(&bcache_minor,
+				d->disk->first_minor / BCACHE_MINORS);
 		put_disk(d->disk);
 	}
 
@@ -784,7 +785,7 @@ static int bcache_device_init(struct bcache_device *d, unsigned block_size,
 
 	if (!(d->bio_split = bioset_create(4, offsetof(struct bbio, bio))) ||
 	    !(d->disk = alloc_disk(BCACHE_MINORS))) {
-		ida_simple_remove(&bcache_minor, minor);
+		ida_simple_remove(&bcache_minor, minor / BCACHE_MINORS);
 		return -ENOMEM;
 	}
 
-- 
1.8.3.1

[toc] | [next] | [standalone]


#1673351 — Re: [PATCH] bcache: release the allocated id, not its multiple of BCACHE_MINORS

FromColy Li <i@coly.li>
Date2017-06-23 10:20 +0200
SubjectRe: [PATCH] bcache: release the allocated id, not its multiple of BCACHE_MINORS
Message-ID<tVrYS-8aL-15@gated-at.bofh.it>
In reply to#1673316
On 2017/6/23 下午3:15, Liang Chen wrote:
> The id passed to ida_simple_remove has to be the one originally
> allocated with ida_simple_get, not the one after multipling by
> BCACHE_MINORS.
> 
> Signed-off-by: Liang Chen <liangchen.linux@gmail.com>
> ---
>  drivers/md/bcache/super.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c
> index e57353e..9f64477 100644
> --- a/drivers/md/bcache/super.c
> +++ b/drivers/md/bcache/super.c
> @@ -734,7 +734,8 @@ static void bcache_device_free(struct bcache_device *d)
>  	if (d->disk && d->disk->queue)
>  		blk_cleanup_queue(d->disk->queue);
>  	if (d->disk) {
> -		ida_simple_remove(&bcache_minor, d->disk->first_minor);
> +		ida_simple_remove(&bcache_minor,
> +				d->disk->first_minor / BCACHE_MINORS);
>  		put_disk(d->disk);
>  	}
>  
> @@ -784,7 +785,7 @@ static int bcache_device_init(struct bcache_device *d, unsigned block_size,
>  
>  	if (!(d->bio_split = bioset_create(4, offsetof(struct bbio, bio))) ||
>  	    !(d->disk = alloc_disk(BCACHE_MINORS))) {
> -		ida_simple_remove(&bcache_minor, minor);
> +		ida_simple_remove(&bcache_minor, minor / BCACHE_MINORS);
>  		return -ENOMEM;
>  	}
>  
> 

Hi Liang,

Junhui fixes it already, the patch is submitted to Jens Axboe already.
Maybe the patch will show up in next merge window.


-- 
Coly Li

[toc] | [prev] | [next] | [standalone]


#1673488

FromLiang Chen <liangchen.linux@gmail.com>
Date2017-06-23 13:40 +0200
Message-ID<tVv6q-1z0-21@gated-at.bofh.it>
In reply to#1673351
Hi Coly,
Thanks for letting me know.  Glad to see it's fixed.

Thanks,
Liang

On Fri, Jun 23, 2017 at 3:30 PM, Coly Li <i@coly.li> wrote:
> On 2017/6/23 下午3:15, Liang Chen wrote:
>> The id passed to ida_simple_remove has to be the one originally
>> allocated with ida_simple_get, not the one after multipling by
>> BCACHE_MINORS.
>>
>> Signed-off-by: Liang Chen <liangchen.linux@gmail.com>
>> ---
>>  drivers/md/bcache/super.c | 5 +++--
>>  1 file changed, 3 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c
>> index e57353e..9f64477 100644
>> --- a/drivers/md/bcache/super.c
>> +++ b/drivers/md/bcache/super.c
>> @@ -734,7 +734,8 @@ static void bcache_device_free(struct bcache_device *d)
>>       if (d->disk && d->disk->queue)
>>               blk_cleanup_queue(d->disk->queue);
>>       if (d->disk) {
>> -             ida_simple_remove(&bcache_minor, d->disk->first_minor);
>> +             ida_simple_remove(&bcache_minor,
>> +                             d->disk->first_minor / BCACHE_MINORS);
>>               put_disk(d->disk);
>>       }
>>
>> @@ -784,7 +785,7 @@ static int bcache_device_init(struct bcache_device *d, unsigned block_size,
>>
>>       if (!(d->bio_split = bioset_create(4, offsetof(struct bbio, bio))) ||
>>           !(d->disk = alloc_disk(BCACHE_MINORS))) {
>> -             ida_simple_remove(&bcache_minor, minor);
>> +             ida_simple_remove(&bcache_minor, minor / BCACHE_MINORS);
>>               return -ENOMEM;
>>       }
>>
>>
>
> Hi Liang,
>
> Junhui fixes it already, the patch is submitted to Jens Axboe already.
> Maybe the patch will show up in next merge window.
>
>
> --
> Coly Li

[toc] | [prev] | [next] | [standalone]


#1673489

FromLiang Chen <liangchen.linux@gmail.com>
Date2017-06-23 13:40 +0200
Message-ID<tVv6p-1z0-17@gated-at.bofh.it>
In reply to#1673316
Sure! I will find you there:)

On Fri, Jun 23, 2017 at 3:28 PM,  <tang.junhui@zte.com.cn> wrote:
> Hello Liang chen:
>
> Please see this patch:
>
> http://www.spinics.net/lists/linux-bcache/msg04572.html
>
> Do you have a wechat account? please add me: tangjunhui1984
>
> We can talk more about bcache.
>
> Thanks.
>
>
>
> 发件人:         Liang Chen <liangchen.linux@gmail.com>
> 收件人:         linux-bcache@vger.kernel.org,
> 抄送:        linux-kernel@vger.kernel.org, colyli@suse.de,
> bcache@linux.ewheeler.net, Liang Chen <liangchen.linux@gmail.com>
> 日期:         2017/06/23 15:16
> 主题:        [PATCH] bcache: release the allocated id, not its multiple of
> BCACHE_MINORS
> 发件人:        linux-bcache-owner@vger.kernel.org
> ________________________________
>
>
>
> The id passed to ida_simple_remove has to be the one originally
> allocated with ida_simple_get, not the one after multipling by
> BCACHE_MINORS.
>
> Signed-off-by: Liang Chen <liangchen.linux@gmail.com>
> ---
> drivers/md/bcache/super.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c
> index e57353e..9f64477 100644
> --- a/drivers/md/bcache/super.c
> +++ b/drivers/md/bcache/super.c
> @@ -734,7 +734,8 @@ static void bcache_device_free(struct bcache_device *d)
>                  if (d->disk && d->disk->queue)
>                                   blk_cleanup_queue(d->disk->queue);
>                  if (d->disk) {
> -                                  ida_simple_remove(&bcache_minor,
> d->disk->first_minor);
> +                                  ida_simple_remove(&bcache_minor,
> +
> d->disk->first_minor / BCACHE_MINORS);
>                                   put_disk(d->disk);
>                  }
>
> @@ -784,7 +785,7 @@ static int bcache_device_init(struct bcache_device *d,
> unsigned block_size,
>
>                  if (!(d->bio_split = bioset_create(4, offsetof(struct bbio,
> bio))) ||
>                      !(d->disk = alloc_disk(BCACHE_MINORS))) {
> -                                  ida_simple_remove(&bcache_minor, minor);
> +                                  ida_simple_remove(&bcache_minor, minor /
> BCACHE_MINORS);
>                                   return -ENOMEM;
>                  }
>
> --
> 1.8.3.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-bcache" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
>

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web