Re: Warning and BUG using btrfs-vol -b

2009-10-07 Thread Diego Calleja
By the way, i think it'd be useful if debug-tree would tell which policy
the fs is applying to each chunk. Something like this:

item 4 key (FIRST_CHUNK_TREE CHUNK_ITEM 8379826176) itemoff 3495 
itemsize 112
chunk length 319881216 owner 2 type 17 (data on RAID1) 
num_stripes 2
stripe 0 devid 2 offset 2265382912
stripe 1 devid 1 offset 989003776


Index: btrfs-progs-unstable/print-tree.c
===
--- btrfs-progs-unstable.orig/print-tree.c  2009-10-07 16:44:53.013210615 
+0200
+++ btrfs-progs-unstable/print-tree.c   2009-10-07 21:37:46.162546261 +0200
@@ -79,15 +79,37 @@
return 0;
 }
 
+static void print_chunk_type(u64 chunk_flags)
+{
+   printf(" type %llu (", chunk_flags);
+
+   if (chunk_flags & BTRFS_BLOCK_GROUP_DATA)
+   printf("data");
+   if (chunk_flags & BTRFS_BLOCK_GROUP_METADATA)
+   printf("metadata");
+   if (chunk_flags & BTRFS_BLOCK_GROUP_SYSTEM)
+   printf("system??");
+   if (chunk_flags & BTRFS_BLOCK_GROUP_DUP)
+   printf("dup??");
+   if (chunk_flags & BTRFS_BLOCK_GROUP_RAID0)
+   printf(" on RAID0");
+   if (chunk_flags & BTRFS_BLOCK_GROUP_RAID1)
+   printf(" on RAID1");
+   if (chunk_flags & BTRFS_BLOCK_GROUP_RAID10)
+   printf(" on RAID10");
+   printf(") ");
+}
+
 static void print_chunk(struct extent_buffer *eb, struct btrfs_chunk *chunk)
 {
int num_stripes = btrfs_chunk_num_stripes(eb, chunk);
int i;
-   printf("\t\tchunk length %llu owner %llu type %llu num_stripes %d\n",
+   printf("\t\tchunk length %llu owner %llu",
   (unsigned long long)btrfs_chunk_length(eb, chunk),
-  (unsigned long long)btrfs_chunk_owner(eb, chunk),
-  (unsigned long long)btrfs_chunk_type(eb, chunk),
-  num_stripes);
+  (unsigned long long)btrfs_chunk_owner(eb, chunk));
+   print_chunk_type((unsigned long long)btrfs_chunk_type(eb, chunk));
+   printf("num_stripes %d\n", num_stripes);
+
for (i = 0 ; i < num_stripes ; i++) {
printf("\t\t\tstripe %d devid %llu offset %llu\n", i,
  (unsigned long long)btrfs_stripe_devid_nr(eb, chunk, i),
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Warning and BUG using btrfs-vol -b

2009-10-07 Thread Diego Calleja
On Wednesday 07 October 2009 21:45:29 Chris Mason escribió:
> I'm afraid this is good old enospc.  Balancing still needs some work to
> be completely safe.

I've tried using less data and raid1, but I can't reproduce it.
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Warning and BUG using btrfs-vol -b

2009-10-07 Thread Chris Mason
On Wed, Oct 07, 2009 at 09:10:28PM +0200, Diego Calleja wrote:
> On Wednesday 07 October 2009 16:33:09 Chris Mason escribió:
> > Ok, in this case you ended up with raid0 on the data.  If you:
> > 
> > mkfs.btrfs -d raid1 /dev/loop0 /dev/loop1 you'll get data raid1.
> 
> I got a BUG...but it may be a different bug. Unlike the last time,
> I didn't even need to zero one of the "disks", the second I
> rebalanced it oopsed:

I'm afraid this is good old enospc.  Balancing still needs some work to
be completely safe.

-chris
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Warning and BUG using btrfs-vol -b

2009-10-07 Thread Diego Calleja
On Wednesday 07 October 2009 16:33:09 Chris Mason escribió:
> Ok, in this case you ended up with raid0 on the data.  If you:
> 
> mkfs.btrfs -d raid1 /dev/loop0 /dev/loop1 you'll get data raid1.

I got a BUG...but it may be a different bug. Unlike the last time,
I didn't even need to zero one of the "disks", the second I
rebalanced it oopsed:

[  705.060358] btrfs: relocating block group 4194304 flags 4
  
[ 1006.106133] btrfs: relocating block group 570428 flags 18
  
[ 1006.336521] btrfs: found 1 extents   
  
[ 1006.469967] btrfs: relocating block group 5384896512 flags 20
  
[ 1006.471043] btrfs allocation failed flags 20, wanted 4096
  
[ 1006.471048] space_info has 317378560 free, is full   
  
[ 1006.471052] space_info total=319881216, pinned=16384, delalloc=0, may_use=0, 
used=2355200, root=2875392, super=131072, reserved=0


[ 1006.471058] block group 5384896512 has 319881216 bytes, 2355200 used 16384 
pinned 0 reserved   
[ 1006.471063] entry offset 5384896512, bytes 483328, bitmap yes
  
[ 1006.471065] block group has cluster?: yes
  
[ 1006.471067] 1 blocks of free space at or bigger than bytes is
  
[ 1006.471092] [ cut here ] 
  
[ 1006.471094] kernel BUG at fs/btrfs/transaction.c:1001!   
  
[ 1006.471098] invalid opcode:  [#1] PREEMPT SMP
  
[ 1006.471103] last sysfs file: /sys/devices/virtual/block/loop0/range  
  
[ 1006.471106] CPU 0
  
[ 1006.471109] Modules linked in: ppp_deflate bsd_comp ppp_async crc_ccitt 
btrfs zlib_deflate crc32c libcrc32c loop ppp_generic slhc kvm_intel kvm i915 
snd_ca0106 snd_rawmidi drm_kms_helper snd_ac97_codec ac97_bus cfbcopyarea 
snd_pcm_oss video snd_mixer_oss backlight snd_pcm snd_timer cfbimgblt processor 
wacom intel_agp cfbfillrect button snd soundcore snd_page_alloc usbhid fan fuse 
ehci_hcd uhci_hcd thermal thermal_sys atl1 mii usbcore  
  
[ 1006.471159] Pid: 8207, comm: btrfs-vol Not tainted 2.6.32-rc3 #1 System 
Product Name   
[ 1006.471162] RIP: 0010:[]  [] 
btrfs_commit_transaction+0x6c5/0x6f0 [btrfs]  
[ 1006.471183] RSP: 0018:8800bc285a78  EFLAGS: 00010286 
  
[ 1006.471186] RAX: ffe4 RBX: 8800bdef5800 RCX: 
0016  
[ 1006.471189] RDX:  RSI: 8800bc2859f8 RDI: 
8800a86d8060  
[ 1006.471192] RBP: 8800bc285b18 R08:  R09: 
  
[ 1006.471195] R10:  R11:  R12: 
8800a181f5c0  
[ 1006.471199] R13: 8800a1eb1ae0 R14: 8800bc285ab8 R15: 8800a1eb1b50
[ 1006.471202] FS:  7f7c5427f730() GS:88000180() 
knlGS:
[ 1006.471206] CS:  0010 DS:  ES:  CR0: 8005003b
[ 1006.471209] CR2: 02812500 CR3: a2f88000 CR4: 26f0
[ 1006.471212] DR0:  DR1:  DR2: 
[ 1006.471215] DR3:  DR6: 0ff0 DR7: 0400
[ 1006.471219] Process btrfs-vol (pid: 8207, threadinfo 8800bc284000, task 
88000b2bae00)
[ 1006.471221] Stack:
[ 1006.471223]  8800bc285ad8 0206 0001bf15ad00 
0110
[ 1006.471229] <0> 8800a181f5c0 0004 8800a1eb1b80 
8800a1eb1ae0
[ 1006.471235] <0>  88000b2bae00 8106eb30 
8800bc285ad0
[ 1006.471242] Call Trace:
[ 1006.471250]  [] ? autoremove_wake_function+0x0/0x40
[ 1006.471264]  [] ? start_transaction+0x11e/0x170 [btrfs]
[ 1006.471285]  [] relocate_block_group+0xec/0x4b0 [btrfs]
[ 1006.471291]  [] ? sub_preempt_count+0x59

Re: Warning and BUG using btrfs-vol -b

2009-10-07 Thread Chris Mason
On Wed, Oct 07, 2009 at 03:51:46PM +0200, Diego Calleja wrote:
> On Wednesday 07 October 2009 05:17:54 Chris Mason escribió:
> 
> > Thanks, I'll try to reproduce.  Which raid level did you use for data?
> > If not raid1, could you try with raid1? ;)
> 
> I'm not sure, since the utils won't tell. I mkfs'ed and mounted one of the 
> 3.5GB
> files with no special options, and copied some files on it. I mkfs'ed the 
> second
> file, put it in a loop device, and added it to the pool with btrfs-vol -a. 
> Then
> I run btrfs-vol -b and I copied more files and rebalanced several times.
> 
> Then I zeroed one of the files used as disks, and tried to read the files in
> the volume (unsucessfully). Then I rebalanced, and I hit the oops. It seems to
> be very reproducible.

Ok, in this case you ended up with raid0 on the data.  If you:

mkfs.btrfs -d raid1 /dev/loop0 /dev/loop1 you'll get data raid1.

-chris

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Warning and BUG using btrfs-vol -b

2009-10-07 Thread Diego Calleja
On Wednesday 07 October 2009 05:17:54 Chris Mason escribió:

> Thanks, I'll try to reproduce.  Which raid level did you use for data?
> If not raid1, could you try with raid1? ;)

I'm not sure, since the utils won't tell. I mkfs'ed and mounted one of the 3.5GB
files with no special options, and copied some files on it. I mkfs'ed the second
file, put it in a loop device, and added it to the pool with btrfs-vol -a. Then
I run btrfs-vol -b and I copied more files and rebalanced several times.

Then I zeroed one of the files used as disks, and tried to read the files in
the volume (unsucessfully). Then I rebalanced, and I hit the oops. It seems to
be very reproducible.
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Warning and BUG using btrfs-vol -b

2009-10-06 Thread Chris Mason
On Tue, Oct 06, 2009 at 08:48:32PM +0200, Diego Calleja wrote:
> I was playing with btrfs with 2 files of 3.5 GB (using loop), I completely
> zeroed one of the files. As expected, I had checksum failures, and I run
> btrfs-vol -b just to see what happened, and I got this (using -rc3):

Thanks, I'll try to reproduce.  Which raid level did you use for data?
If not raid1, could you try with raid1? ;)

-chris
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html