All of lore.kernel.org
 help / color / mirror / Atom feed
* 4.11: da_remove called for id=16 which is not allocated.
@ 2017-05-14 15:25 Marc MERLIN
  2017-05-14 17:55 ` Marc MERLIN
  2017-05-18 17:08 ` 4.11: ida_remove " Eric Wheeler
  0 siblings, 2 replies; 9+ messages in thread
From: Marc MERLIN @ 2017-05-14 15:25 UTC (permalink / raw)
  To: linux-btrfs


gargamel:/sys/block/bcache16/bcache# echo 1 > stop

bcache: bcache_device_free() bcache16 stopped
------------[ cut here ]------------
WARNING: CPU: 7 PID: 11051 at lib/idr.c:383 ida_remove+0xe8/0x10b
ida_remove called for id=16 which is not allocated.
Modules linked in: uas usb_storage veth ip6table_filter ip6_tables ebtable_nat ebtables ppdev lp xt_addrtype br_netfilter bridge stp llc tun autofs4 softdog binfmt_misc ftdi_sio nfsd auth_rpcgss nfs_acl nfs lockd grace fscache sunrpc ipt_REJECT nf_reject_ipv4 xt_conntrack xt_mark xt_nat xt_tcpudp nf_log_ipv4 nf_log_common xt_LOG iptable_mangle iptable_filter lm85 hwmon_vid pl2303 dm_snapshot dm_bufio iptable_nat ip_tables nf_conntrack_ipv4 nf_defrag_ipv4 nf_nat_ipv4 nf_conntrack_ftp ipt_MASQUERADE nf_nat_masquerade_ipv4 nf_nat nf_conntrack x_tables sg st snd_pcm_oss snd_mixer_oss bcache kvm_intel kvm irqbypass snd_hda_codec_realtek snd_hda_codec_generic snd_cmipci snd_hda_intel snd_mpu401_uart snd_opl3_lib snd_hda_codec snd_rawmidi snd_hda_core rc_ati_x10 snd_hwdep snd_seq_device ati_remote
 snd_pcm eeepc_wmi asix snd_timer usbserial asus_wmi usbnet rc_core snd sparse_keymap libphy rfkill hwmon lpc_ich soundcore mei_me parport_pc wmi tpm_infineon parport tpm_tis i2c_i801 battery input_leds tpm_tis_core i915 tpm pcspkr evdev e1000e ptp pps_core fuse raid456 multipath mmc_block mmc_core lrw ablk_helper dm_crypt dm_mod async_raid6_recov async_pq async_xor async_memcpy async_tx crc32c_intel blowfish_x86_64 blowfish_common pcbc aesni_intel aes_x86_64 crypto_simd glue_helper cryptd xhci_pci ehci_pci xhci_hcd ehci_hcd r8169 sata_sil24 mii usbcore thermal mvsas fan libsas scsi_transport_sas [last unloaded: ftdi_sio]
CPU: 7 PID: 11051 Comm: kworker/7:13 Tainted: G     U  W       4.11.0-amd64-preempt-sysrq-20170406 #2
Hardware name: System manufacturer System Product Name/P8H67-M PRO, BIOS 3904 04/27/2013
Workqueue: events cached_dev_free [bcache]
Call Trace:
 dump_stack+0x61/0x7d
 __warn+0xc2/0xdd
 warn_slowpath_fmt+0x5a/0x76
 ida_remove+0xe8/0x10b
 ida_simple_remove+0x2e/0x43
 bcache_device_free+0x8c/0xc4 [bcache]
 cached_dev_free+0x6b/0xe1 [bcache]
 process_one_work+0x193/0x2b0
 worker_thread+0x1e9/0x2c1
 ? rescuer_thread+0x2b1/0x2b1
 kthread+0xfb/0x100
 ? init_completion+0x24/0x24
 ret_from_fork+0x2c/0x40
---[ end trace 12586d8b165ff8f2 ]---

Prior to that: 
cd /sys/fs/bcache/5bc072a8-ab17-446d-9744-e247949913c1
echo 1 > stop

I needed to complete stop and remove all traces of a bcache before I could 
mdadm --stop the underlying array.

Marc
-- 
"A mouse is a device used to point at the xterm you want to type in" - A.S.R.
Microsoft is to operating systems ....
                                      .... what McDonalds is to gourmet cooking
Home page: http://marc.merlins.org/                         | PGP 1024R/763BE901

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: 4.11: da_remove called for id=16 which is not allocated.
  2017-05-14 15:25 4.11: da_remove called for id=16 which is not allocated Marc MERLIN
@ 2017-05-14 17:55 ` Marc MERLIN
  2017-05-18 17:08 ` 4.11: ida_remove " Eric Wheeler
  1 sibling, 0 replies; 9+ messages in thread
From: Marc MERLIN @ 2017-05-14 17:55 UTC (permalink / raw)
  To: linux-btrfs

My apologies, this was for the bcache list, sorry about this.

On Sun, May 14, 2017 at 08:25:22AM -0700, Marc MERLIN wrote:
> 
> gargamel:/sys/block/bcache16/bcache# echo 1 > stop
> 
> bcache: bcache_device_free() bcache16 stopped
> ------------[ cut here ]------------
> WARNING: CPU: 7 PID: 11051 at lib/idr.c:383 ida_remove+0xe8/0x10b
> ida_remove called for id=16 which is not allocated.
> Modules linked in: uas usb_storage veth ip6table_filter ip6_tables ebtable_nat ebtables ppdev lp xt_addrtype br_netfilter bridge stp llc tun autofs4 softdog binfmt_misc ftdi_sio nfsd auth_rpcgss nfs_acl nfs lockd grace fscache sunrpc ipt_REJECT nf_reject_ipv4 xt_conntrack xt_mark xt_nat xt_tcpudp nf_log_ipv4 nf_log_common xt_LOG iptable_mangle iptable_filter lm85 hwmon_vid pl2303 dm_snapshot dm_bufio iptable_nat ip_tables nf_conntrack_ipv4 nf_defrag_ipv4 nf_nat_ipv4 nf_conntrack_ftp ipt_MASQUERADE nf_nat_masquerade_ipv4 nf_nat nf_conntrack x_tables sg st snd_pcm_oss snd_mixer_oss bcache kvm_intel kvm irqbypass snd_hda_codec_realtek snd_hda_codec_generic snd_cmipci snd_hda_intel snd_mpu401_uart snd_opl3_lib snd_hda_codec snd_rawmidi snd_hda_core rc_ati_x10 snd_hwdep snd_seq_device ati_remote
>  snd_pcm eeepc_wmi asix snd_timer usbserial asus_wmi usbnet rc_core snd sparse_keymap libphy rfkill hwmon lpc_ich soundcore mei_me parport_pc wmi tpm_infineon parport tpm_tis i2c_i801 battery input_leds tpm_tis_core i915 tpm pcspkr evdev e1000e ptp pps_core fuse raid456 multipath mmc_block mmc_core lrw ablk_helper dm_crypt dm_mod async_raid6_recov async_pq async_xor async_memcpy async_tx crc32c_intel blowfish_x86_64 blowfish_common pcbc aesni_intel aes_x86_64 crypto_simd glue_helper cryptd xhci_pci ehci_pci xhci_hcd ehci_hcd r8169 sata_sil24 mii usbcore thermal mvsas fan libsas scsi_transport_sas [last unloaded: ftdi_sio]
> CPU: 7 PID: 11051 Comm: kworker/7:13 Tainted: G     U  W       4.11.0-amd64-preempt-sysrq-20170406 #2
> Hardware name: System manufacturer System Product Name/P8H67-M PRO, BIOS 3904 04/27/2013
> Workqueue: events cached_dev_free [bcache]
> Call Trace:
>  dump_stack+0x61/0x7d
>  __warn+0xc2/0xdd
>  warn_slowpath_fmt+0x5a/0x76
>  ida_remove+0xe8/0x10b
>  ida_simple_remove+0x2e/0x43
>  bcache_device_free+0x8c/0xc4 [bcache]
>  cached_dev_free+0x6b/0xe1 [bcache]
>  process_one_work+0x193/0x2b0
>  worker_thread+0x1e9/0x2c1
>  ? rescuer_thread+0x2b1/0x2b1
>  kthread+0xfb/0x100
>  ? init_completion+0x24/0x24
>  ret_from_fork+0x2c/0x40
> ---[ end trace 12586d8b165ff8f2 ]---
> 
> Prior to that: 
> cd /sys/fs/bcache/5bc072a8-ab17-446d-9744-e247949913c1
> echo 1 > stop
> 
> I needed to complete stop and remove all traces of a bcache before I could 
> mdadm --stop the underlying array.
> 
> Marc
> -- 
> "A mouse is a device used to point at the xterm you want to type in" - A.S.R.
> Microsoft is to operating systems ....
>                                       .... what McDonalds is to gourmet cooking
> Home page: http://marc.merlins.org/                         | PGP 1024R/763BE901

-- 
"A mouse is a device used to point at the xterm you want to type in" - A.S.R.
Microsoft is to operating systems ....
                                      .... what McDonalds is to gourmet cooking
Home page: http://marc.merlins.org/                         | PGP 1024R/763BE901

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: 4.11: ida_remove called for id=16 which is not allocated.
  2017-05-14 15:25 4.11: da_remove called for id=16 which is not allocated Marc MERLIN
  2017-05-14 17:55 ` Marc MERLIN
@ 2017-05-18 17:08 ` Eric Wheeler
  2017-05-19 17:10   ` Marc MERLIN
  2017-06-05  1:55   ` Marc MERLIN
  1 sibling, 2 replies; 9+ messages in thread
From: Eric Wheeler @ 2017-05-18 17:08 UTC (permalink / raw)
  To: Marc MERLIN; +Cc: linux-bcache

On Sun, 14 May 2017, Marc MERLIN wrote:

> 
> gargamel:/sys/block/bcache16/bcache# echo 1 > stop
> 
> bcache: bcache_device_free() bcache16 stopped
> ------------[ cut here ]------------
> WARNING: CPU: 7 PID: 11051 at lib/idr.c:383 ida_remove+0xe8/0x10b
> ida_remove called for id=16 which is not allocated.

Hi Marc,

Try the patch below.  I'm preparing it for a pull request---its been 
compile tested but not actually tested.  If you can confirm that this 
fixes it I'll add your Tested-by: if you like.

--
Eric Wheeler

commit 7311ad5a130ba79050e6f803f7fdb4e2b3f259d6
Author: tang.junhui <tang.junhui@zte.com.cn>
Date:   Tue May 9 12:14:06 2017 -0700

    bcache: fix calling ida_simple_remove() with incorrect minor
    
    bcache called ida_simple_remove() with minor which have multiplied by
    BCACHE_MINORS, it would cause minor wrong release and leakage.
    
    In addition, when adding partition support to bcache, the name assignment
    was not updated, resulting in numbers jumping (bcache0, bcache16,
    bcache32...). This has been fixed implicitly by the rework.
    
    Signed-off-by: tang.junhui <tang.junhui@zte.com.cn>
    Reviewed-by: Coly Li <colyli@suse.de>
    Reviewed-by: Eric Wheeler <bcache@linux.ewheeler.net>
    Cc: stable@vger.kernel.org # 4.10
    Cc: Stefan Bader <stefan.bader@canonical.com>
    Fixes: b8c0d91 (bcache: partition support: add 16 minors per bcacheN device)
    BugLink: https://bugs.launchpad.net/bugs/1667078

diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c
index 0f9242d..2b07933 100644
--- a/drivers/md/bcache/super.c
+++ b/drivers/md/bcache/super.c
@@ -58,7 +58,10 @@
 struct workqueue_struct *bcache_wq;
 
 #define BTREE_MAX_PAGES		(256 * 1024 / PAGE_SIZE)
-#define BCACHE_MINORS		16 /* partition support */
+#define BCACHE_MINORS_BITS                4 /* bcache partition support */
+#define BCACHE_MINORS                     (1 << BCACHE_MINORS_BITS)
+#define BCACHE_TO_IDA_MINORS(first_minor) ((first_minor) >> BCACHE_MINORS_BITS)
+#define IDA_TO_BCACHE_MINORS(minor)       ((minor) << BCACHE_MINORS_BITS)
 
 /* Superblock */
 
@@ -734,7 +737,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,
+			BCACHE_TO_IDA_MINORS(d->disk->first_minor));
 		put_disk(d->disk);
 	}
 
@@ -776,11 +780,11 @@ static int bcache_device_init(struct bcache_device *d, unsigned block_size,
 	if (!d->full_dirty_stripes)
 		return -ENOMEM;
 
-	minor = ida_simple_get(&bcache_minor, 0, MINORMASK + 1, GFP_KERNEL);
+	minor = ida_simple_get(&bcache_minor, 0,
+		BCACHE_TO_IDA_MINORS(MINORMASK) + 1, GFP_KERNEL);
 	if (minor < 0)
 		return minor;
 
-	minor *= BCACHE_MINORS;
 
 	if (!(d->bio_split = bioset_create(4, offsetof(struct bbio, bio))) ||
 	    !(d->disk = alloc_disk(BCACHE_MINORS))) {
@@ -792,7 +796,7 @@ static int bcache_device_init(struct bcache_device *d, unsigned block_size,
 	snprintf(d->disk->disk_name, DISK_NAME_LEN, "bcache%i", minor);
 
 	d->disk->major		= bcache_major;
-	d->disk->first_minor	= minor;
+	d->disk->first_minor	= IDA_TO_BCACHE_MINORS(minor);
 	d->disk->fops		= &bcache_ops;
 	d->disk->private_data	= d;
 

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: 4.11: ida_remove called for id=16 which is not allocated.
  2017-05-18 17:08 ` 4.11: ida_remove " Eric Wheeler
@ 2017-05-19 17:10   ` Marc MERLIN
  2017-06-05  1:55   ` Marc MERLIN
  1 sibling, 0 replies; 9+ messages in thread
From: Marc MERLIN @ 2017-05-19 17:10 UTC (permalink / raw)
  To: Eric Wheeler; +Cc: linux-bcache

On Thu, May 18, 2017 at 05:08:56PM +0000, Eric Wheeler wrote:
> On Sun, 14 May 2017, Marc MERLIN wrote:
> 
> > 
> > gargamel:/sys/block/bcache16/bcache# echo 1 > stop
> > 
> > bcache: bcache_device_free() bcache16 stopped
> > ------------[ cut here ]------------
> > WARNING: CPU: 7 PID: 11051 at lib/idr.c:383 ida_remove+0xe8/0x10b
> > ida_remove called for id=16 which is not allocated.
> 
> Hi Marc,
> 
> Try the patch below.  I'm preparing it for a pull request---its been 
> compile tested but not actually tested.  If you can confirm that this 
> fixes it I'll add your Tested-by: if you like.
 
Thanks for the patch.
I'll hve to try it, but it may take a little while, I'm in the middle of
recovering 2 of my multi terabyte arrays after multiple bugs due to a
new SAS card and apparently new issues in 4.11

Marc

> --
> Eric Wheeler
> 
> commit 7311ad5a130ba79050e6f803f7fdb4e2b3f259d6
> Author: tang.junhui <tang.junhui@zte.com.cn>
> Date:   Tue May 9 12:14:06 2017 -0700
> 
>     bcache: fix calling ida_simple_remove() with incorrect minor
>     
>     bcache called ida_simple_remove() with minor which have multiplied by
>     BCACHE_MINORS, it would cause minor wrong release and leakage.
>     
>     In addition, when adding partition support to bcache, the name assignment
>     was not updated, resulting in numbers jumping (bcache0, bcache16,
>     bcache32...). This has been fixed implicitly by the rework.
>     
>     Signed-off-by: tang.junhui <tang.junhui@zte.com.cn>
>     Reviewed-by: Coly Li <colyli@suse.de>
>     Reviewed-by: Eric Wheeler <bcache@linux.ewheeler.net>
>     Cc: stable@vger.kernel.org # 4.10
>     Cc: Stefan Bader <stefan.bader@canonical.com>
>     Fixes: b8c0d91 (bcache: partition support: add 16 minors per bcacheN device)
>     BugLink: https://bugs.launchpad.net/bugs/1667078
> 
> diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c
> index 0f9242d..2b07933 100644
> --- a/drivers/md/bcache/super.c
> +++ b/drivers/md/bcache/super.c
> @@ -58,7 +58,10 @@
>  struct workqueue_struct *bcache_wq;
>  
>  #define BTREE_MAX_PAGES		(256 * 1024 / PAGE_SIZE)
> -#define BCACHE_MINORS		16 /* partition support */
> +#define BCACHE_MINORS_BITS                4 /* bcache partition support */
> +#define BCACHE_MINORS                     (1 << BCACHE_MINORS_BITS)
> +#define BCACHE_TO_IDA_MINORS(first_minor) ((first_minor) >> BCACHE_MINORS_BITS)
> +#define IDA_TO_BCACHE_MINORS(minor)       ((minor) << BCACHE_MINORS_BITS)
>  
>  /* Superblock */
>  
> @@ -734,7 +737,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,
> +			BCACHE_TO_IDA_MINORS(d->disk->first_minor));
>  		put_disk(d->disk);
>  	}
>  
> @@ -776,11 +780,11 @@ static int bcache_device_init(struct bcache_device *d, unsigned block_size,
>  	if (!d->full_dirty_stripes)
>  		return -ENOMEM;
>  
> -	minor = ida_simple_get(&bcache_minor, 0, MINORMASK + 1, GFP_KERNEL);
> +	minor = ida_simple_get(&bcache_minor, 0,
> +		BCACHE_TO_IDA_MINORS(MINORMASK) + 1, GFP_KERNEL);
>  	if (minor < 0)
>  		return minor;
>  
> -	minor *= BCACHE_MINORS;
>  
>  	if (!(d->bio_split = bioset_create(4, offsetof(struct bbio, bio))) ||
>  	    !(d->disk = alloc_disk(BCACHE_MINORS))) {
> @@ -792,7 +796,7 @@ static int bcache_device_init(struct bcache_device *d, unsigned block_size,
>  	snprintf(d->disk->disk_name, DISK_NAME_LEN, "bcache%i", minor);
>  
>  	d->disk->major		= bcache_major;
> -	d->disk->first_minor	= minor;
> +	d->disk->first_minor	= IDA_TO_BCACHE_MINORS(minor);
>  	d->disk->fops		= &bcache_ops;
>  	d->disk->private_data	= d;
>  
> 

-- 
"A mouse is a device used to point at the xterm you want to type in" - A.S.R.
Microsoft is to operating systems ....
                                      .... what McDonalds is to gourmet cooking
Home page: http://marc.merlins.org/                         | PGP 1024R/763BE901

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: 4.11: ida_remove called for id=16 which is not allocated.
  2017-05-18 17:08 ` 4.11: ida_remove " Eric Wheeler
  2017-05-19 17:10   ` Marc MERLIN
@ 2017-06-05  1:55   ` Marc MERLIN
  2017-06-05  2:07     ` Marc MERLIN
  1 sibling, 1 reply; 9+ messages in thread
From: Marc MERLIN @ 2017-06-05  1:55 UTC (permalink / raw)
  To: Eric Wheeler; +Cc: linux-bcache

On Thu, May 18, 2017 at 05:08:56PM +0000, Eric Wheeler wrote:
> On Sun, 14 May 2017, Marc MERLIN wrote:
> 
> > 
> > gargamel:/sys/block/bcache16/bcache# echo 1 > stop
> > 
> > bcache: bcache_device_free() bcache16 stopped
> > ------------[ cut here ]------------
> > WARNING: CPU: 7 PID: 11051 at lib/idr.c:383 ida_remove+0xe8/0x10b
> > ida_remove called for id=16 which is not allocated.
> 
> Hi Marc,
> 
> Try the patch below.  I'm preparing it for a pull request---its been 
> compile tested but not actually tested.  If you can confirm that this 
> fixes it I'll add your Tested-by: if you like.
 
Sorry for the delay, I had to recover some arrays first.
I'm back online, got 4.11.3, applied your patch and it seems to have
worked.
gargamel:/sys/block/bcache1/bcache# echo 1 > stop
returned nothing.
Actually I was kind of expecting a note in my logs that the cache had
been stopped, but eh, at least no errors :)

Tested-by: Marc MERLIN <marc@merlins.org>

Thanks,
Marc

> --
> Eric Wheeler
> 
> commit 7311ad5a130ba79050e6f803f7fdb4e2b3f259d6
> Author: tang.junhui <tang.junhui@zte.com.cn>
> Date:   Tue May 9 12:14:06 2017 -0700
> 
>     bcache: fix calling ida_simple_remove() with incorrect minor
>     
>     bcache called ida_simple_remove() with minor which have multiplied by
>     BCACHE_MINORS, it would cause minor wrong release and leakage.
>     
>     In addition, when adding partition support to bcache, the name assignment
>     was not updated, resulting in numbers jumping (bcache0, bcache16,
>     bcache32...). This has been fixed implicitly by the rework.
>     
>     Signed-off-by: tang.junhui <tang.junhui@zte.com.cn>
>     Reviewed-by: Coly Li <colyli@suse.de>
>     Reviewed-by: Eric Wheeler <bcache@linux.ewheeler.net>
>     Cc: stable@vger.kernel.org # 4.10
>     Cc: Stefan Bader <stefan.bader@canonical.com>
>     Fixes: b8c0d91 (bcache: partition support: add 16 minors per bcacheN device)
>     BugLink: https://bugs.launchpad.net/bugs/1667078
> 
> diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c
> index 0f9242d..2b07933 100644
> --- a/drivers/md/bcache/super.c
> +++ b/drivers/md/bcache/super.c
> @@ -58,7 +58,10 @@
>  struct workqueue_struct *bcache_wq;
>  
>  #define BTREE_MAX_PAGES		(256 * 1024 / PAGE_SIZE)
> -#define BCACHE_MINORS		16 /* partition support */
> +#define BCACHE_MINORS_BITS                4 /* bcache partition support */
> +#define BCACHE_MINORS                     (1 << BCACHE_MINORS_BITS)
> +#define BCACHE_TO_IDA_MINORS(first_minor) ((first_minor) >> BCACHE_MINORS_BITS)
> +#define IDA_TO_BCACHE_MINORS(minor)       ((minor) << BCACHE_MINORS_BITS)
>  
>  /* Superblock */
>  
> @@ -734,7 +737,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,
> +			BCACHE_TO_IDA_MINORS(d->disk->first_minor));
>  		put_disk(d->disk);
>  	}
>  
> @@ -776,11 +780,11 @@ static int bcache_device_init(struct bcache_device *d, unsigned block_size,
>  	if (!d->full_dirty_stripes)
>  		return -ENOMEM;
>  
> -	minor = ida_simple_get(&bcache_minor, 0, MINORMASK + 1, GFP_KERNEL);
> +	minor = ida_simple_get(&bcache_minor, 0,
> +		BCACHE_TO_IDA_MINORS(MINORMASK) + 1, GFP_KERNEL);
>  	if (minor < 0)
>  		return minor;
>  
> -	minor *= BCACHE_MINORS;
>  
>  	if (!(d->bio_split = bioset_create(4, offsetof(struct bbio, bio))) ||
>  	    !(d->disk = alloc_disk(BCACHE_MINORS))) {
> @@ -792,7 +796,7 @@ static int bcache_device_init(struct bcache_device *d, unsigned block_size,
>  	snprintf(d->disk->disk_name, DISK_NAME_LEN, "bcache%i", minor);
>  
>  	d->disk->major		= bcache_major;
> -	d->disk->first_minor	= minor;
> +	d->disk->first_minor	= IDA_TO_BCACHE_MINORS(minor);
>  	d->disk->fops		= &bcache_ops;
>  	d->disk->private_data	= d;
>  
> --
> 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
> 

-- 
"A mouse is a device used to point at the xterm you want to type in" - A.S.R.
Microsoft is to operating systems ....
                                      .... what McDonalds is to gourmet cooking
Home page: http://marc.merlins.org/                         | PGP 1024R/763BE901

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: 4.11: ida_remove called for id=16 which is not allocated.
  2017-06-05  1:55   ` Marc MERLIN
@ 2017-06-05  2:07     ` Marc MERLIN
  2017-06-09  1:53       ` Eric Wheeler
  0 siblings, 1 reply; 9+ messages in thread
From: Marc MERLIN @ 2017-06-05  2:07 UTC (permalink / raw)
  To: Eric Wheeler; +Cc: linux-bcache

On Sun, Jun 04, 2017 at 06:55:09PM -0700, Marc MERLIN wrote:
> gargamel:/sys/block/bcache1/bcache# echo 1 > stop
> returned nothing.
> Actually I was kind of expecting a note in my logs that the cache had
> been stopped, but eh, at least no errors :)

Right, but now how do I re-enable my cache?
I can't seem to.

gargamel:/sys/block/md8# ls bcache
ls: cannot access 'bcache': No such file or directory

gargamel:/sys/block/bcache1# l
total 0
drwxr-xr-x  8 root root    0 Jun  4 18:53 ./
drwxr-xr-x 15 root root    0 Jun  4 18:53 ../
-r--r--r--  1 root root 4096 Jun  4 18:53 alignment_offset
-rw-r--r--  1 root root 4096 Jun  4 18:53 badblocks
lrwxrwxrwx  1 root root    0 Jun  4 18:53 bcache -> ../md8/bcache
lrwxrwxrwx  1 root root    0 Jun  4 18:53 bdi -> ../../bdi/252:16/

gargamel:/sys/block/bcache1# l ../md8/bcache
ls: cannot access '../md8/bcache': No such file or directory

 echo /dev/md8 > 4a46e74d-0376-41e7-aff4-0a0497b9e3c5/unregister 
gargamel:/sys/block/bcache1/bcache# echo /dev/md8 >  /sys/fs/bcache/register 
bcache: register_bcache() error opening /dev/md8: device already registered

Looks like stop doesn't unregister the device, I can't re-register it,
nor restart it.

Or am I missing something?
I'd love not to have to reboot to recover :)

Thanks,
Marc
-- 
"A mouse is a device used to point at the xterm you want to type in" - A.S.R.
Microsoft is to operating systems ....
                                      .... what McDonalds is to gourmet cooking
Home page: http://marc.merlins.org/                         | PGP 1024R/763BE901

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: 4.11: ida_remove called for id=16 which is not allocated.
  2017-06-05  2:07     ` Marc MERLIN
@ 2017-06-09  1:53       ` Eric Wheeler
  2017-06-09  2:39         ` Marc MERLIN
  0 siblings, 1 reply; 9+ messages in thread
From: Eric Wheeler @ 2017-06-09  1:53 UTC (permalink / raw)
  To: Marc MERLIN; +Cc: linux-bcache

On Sun, 4 Jun 2017, Marc MERLIN wrote:
> On Sun, Jun 04, 2017 at 06:55:09PM -0700, Marc MERLIN wrote:
> > gargamel:/sys/block/bcache1/bcache# echo 1 > stop
> > returned nothing.
> > Actually I was kind of expecting a note in my logs that the cache had
> > been stopped, but eh, at least no errors :)
> 
> Right, but now how do I re-enable my cache?
> I can't seem to.
> 
> gargamel:/sys/block/md8# ls bcache
> ls: cannot access 'bcache': No such file or directory
> 
> gargamel:/sys/block/bcache1# l
> total 0
> drwxr-xr-x  8 root root    0 Jun  4 18:53 ./
> drwxr-xr-x 15 root root    0 Jun  4 18:53 ../
> -r--r--r--  1 root root 4096 Jun  4 18:53 alignment_offset
> -rw-r--r--  1 root root 4096 Jun  4 18:53 badblocks
> lrwxrwxrwx  1 root root    0 Jun  4 18:53 bcache -> ../md8/bcache
> lrwxrwxrwx  1 root root    0 Jun  4 18:53 bdi -> ../../bdi/252:16/
> 
> gargamel:/sys/block/bcache1# l ../md8/bcache
> ls: cannot access '../md8/bcache': No such file or directory

Don't trust ../ to link correctly with so many symlinks floating around.  
Sometimes ../ will be interpreted correctly via a link path, other times 
it will use the '..' inode's content which may not be the way you came in.  
I'm not saying thats the problem, but perhaps...

>  echo /dev/md8 > 4a46e74d-0376-41e7-aff4-0a0497b9e3c5/unregister 

Try echo 1 > uuid/unregister

> gargamel:/sys/block/bcache1/bcache# echo /dev/md8 >  /sys/fs/bcache/register 
> bcache: register_bcache() error opening /dev/md8: device already registered
> 
> Looks like stop doesn't unregister the device, I can't re-register it,
> nor restart it.
> 
> Or am I missing something?
> I'd love not to have to reboot to recover :)

Is /dev/md8 the cache or bdev?

Did you stop the cache, too, in /sys/fs/bcache/uuid/stop? 

Stopping via /sys/block/bcache0/bcache/stop doesn't stop the cache IIRC.


--
Eric Wheeler


> 
> Thanks,
> Marc
> -- 
> "A mouse is a device used to point at the xterm you want to type in" - A.S.R.
> Microsoft is to operating systems ....
>                                       .... what McDonalds is to gourmet cooking
> Home page: http://marc.merlins.org/                         | PGP 1024R/763BE901
> 

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: 4.11: ida_remove called for id=16 which is not allocated.
  2017-06-09  1:53       ` Eric Wheeler
@ 2017-06-09  2:39         ` Marc MERLIN
  2017-06-09  2:41           ` Marc MERLIN
  0 siblings, 1 reply; 9+ messages in thread
From: Marc MERLIN @ 2017-06-09  2:39 UTC (permalink / raw)
  To: Eric Wheeler; +Cc: linux-bcache

On Fri, Jun 09, 2017 at 01:53:01AM +0000, Eric Wheeler wrote:
> > gargamel:/sys/block/bcache1# l ../md8/bcache
> > ls: cannot access '../md8/bcache': No such file or directory
> 
> Don't trust ../ to link correctly with so many symlinks floating around.  
> Sometimes ../ will be interpreted correctly via a link path, other times 
> it will use the '..' inode's content which may not be the way you came in.  
> I'm not saying thats the problem, but perhaps...
 
Right, but basically it wasn't an issue here, it was just making cut and
paste shorter.

> >  echo /dev/md8 > 4a46e74d-0376-41e7-aff4-0a0497b9e3c5/unregister 
> 
> Try echo 1 > uuid/unregister

I'll try next time if there is one.
Sadly, I couldn't wait anymore and have already rebooted.

> > gargamel:/sys/block/bcache1/bcache# echo /dev/md8 >  /sys/fs/bcache/register 
> > bcache: register_bcache() error opening /dev/md8: device already registered
> > 
> > Looks like stop doesn't unregister the device, I can't re-register it,
> > nor restart it.
> > 
> > Or am I missing something?
> > I'd love not to have to reboot to recover :)
> 
> Is /dev/md8 the cache or bdev?
 
It was the cache. I pasted:
lrwxrwxrwx  1 root root    0 Jun  4 18:53 bcache -> ../md8/bcache
lrwxrwxrwx  1 root root    0 Jun  4 18:53 bdi -> ../../bdi/252:16/

> Did you stop the cache, too, in /sys/fs/bcache/uuid/stop? 
> 
> Stopping via /sys/block/bcache0/bcache/stop doesn't stop the cache IIRC.

I wasn't trying to stop the cache, just to re-assign it to the backing
device it had just been removed from for testing as per your request.

Marc
-- 
"A mouse is a device used to point at the xterm you want to type in" - A.S.R.
Microsoft is to operating systems ....
                                      .... what McDonalds is to gourmet cooking
Home page: http://marc.merlins.org/                         | PGP 1024R/763BE901

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: 4.11: ida_remove called for id=16 which is not allocated.
  2017-06-09  2:39         ` Marc MERLIN
@ 2017-06-09  2:41           ` Marc MERLIN
  0 siblings, 0 replies; 9+ messages in thread
From: Marc MERLIN @ 2017-06-09  2:41 UTC (permalink / raw)
  To: Eric Wheeler; +Cc: linux-bcache

On Thu, Jun 08, 2017 at 07:39:34PM -0700, Marc MERLIN wrote:
> It was the cache. I pasted:
> lrwxrwxrwx  1 root root    0 Jun  4 18:53 bcache -> ../md8/bcache
> lrwxrwxrwx  1 root root    0 Jun  4 18:53 bdi -> ../../bdi/252:16/

Sorry, tired, it was the device with data, not the cache.

Marc
-- 
"A mouse is a device used to point at the xterm you want to type in" - A.S.R.
Microsoft is to operating systems ....
                                      .... what McDonalds is to gourmet cooking
Home page: http://marc.merlins.org/                         | PGP 1024R/763BE901

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2017-06-09  2:41 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-14 15:25 4.11: da_remove called for id=16 which is not allocated Marc MERLIN
2017-05-14 17:55 ` Marc MERLIN
2017-05-18 17:08 ` 4.11: ida_remove " Eric Wheeler
2017-05-19 17:10   ` Marc MERLIN
2017-06-05  1:55   ` Marc MERLIN
2017-06-05  2:07     ` Marc MERLIN
2017-06-09  1:53       ` Eric Wheeler
2017-06-09  2:39         ` Marc MERLIN
2017-06-09  2:41           ` Marc MERLIN

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.