Re: [PATCH] xfstests btrfs/012: test balance while creating and deleting subvolumes

2013-10-09 Thread Wang Shilong
On 10/10/2013 12:52 PM, Eryu Guan wrote: Gui Hecheng has send a patch for this before: [PATCH V2] xfstest: an regression test for btrfs balance https://patchwork.kernel.org/patch/3006261/ Thanks, Wang Do subvolume create/delete in loop at back ground and do filesystem balance at the same time

[PATCH] xfstests btrfs/012: test balance while creating and deleting subvolumes

2013-10-09 Thread Eryu Guan
Do subvolume create/delete in loop at back ground and do filesystem balance at the same time could trigger kernel BUG at fs/btrfs/relocation.c:2255! on 3.12-rc4 kernel. Signed-off-by: Eryu Guan --- tests/btrfs/012 | 74 + tests/btrfs/012.

Re: [PATCH v2] btrfs-progs: calculate disk space that a subvol could free

2013-10-09 Thread Wang Shilong
On 10/10/2013 11:35 AM, Anand Jain wrote: If 'btrfs_file_extent_item' can contain the ref count it would solve the current problem quite easily. (problem is that, its of n * n searches to know data extents with its ref for a given subvol). Just considering btrfs_file_extent_item is not eno

Re: [PATCH v2] btrfs-progs: calculate disk space that a subvol could free

2013-10-09 Thread Anand Jain
If 'btrfs_file_extent_item' can contain the ref count it would solve the current problem quite easily. (problem is that, its of n * n searches to know data extents with its ref for a given subvol). But what'r the challenge(s) to have ref count in the btrfs_file_extent_item ? any thoughts

[PATCH v4] btrfs: Fix memory leakage in the tree-log.c

2013-10-09 Thread Geyslan G. Bem
When 'dir' is NULL, after calling extref_get_fields(), add_inode_ref() can be returning without freeing the 'name' pointer. Added kfree when necessary. Signed-off-by: Geyslan G. Bem --- fs/btrfs/tree-log.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/fs/btrfs/tree-log

Re: [PATCH v3] btrfs: Fix memory leakage in the tree-log.c

2013-10-09 Thread Geyslan Gregório Bem
Josef, Thank you. Sending v4. Geyslan Gregório Bem hackingbits.com 2013/10/9 Josef Bacik : > On Wed, Oct 09, 2013 at 08:40:30PM -0300, Geyslan G. Bem wrote: >> In some cases, add_inode_ref() is returning without freeing >> the 'name' pointer. >> >> Added bail out to explicitly call kfree when n

Re: [PATCH v3] btrfs: Fix memory leakage in the tree-log.c

2013-10-09 Thread Josef Bacik
On Wed, Oct 09, 2013 at 08:40:30PM -0300, Geyslan G. Bem wrote: > In some cases, add_inode_ref() is returning without freeing > the 'name' pointer. > > Added bail out to explicitly call kfree when necessary. > > Signed-off-by: Geyslan G. Bem > --- > fs/btrfs/tree-log.c | 10 -- > 1 file

Re: [PATCH v3] btrfs: Fix memory leakage in the tree-log.c

2013-10-09 Thread Geyslan Gregório Bem
Please, Analyze [PATCH v3]. Regards, Geyslan Gregório Bem hackingbits.com 2013/10/9 Geyslan G. Bem : > In some cases, add_inode_ref() is returning without freeing > the 'name' pointer. > > Added bail out to explicitly call kfree when necessary. > > Signed-off-by: Geyslan G. Bem > --- > fs/bt

[PATCH v3] btrfs: Fix memory leakage in the tree-log.c

2013-10-09 Thread Geyslan G. Bem
In some cases, add_inode_ref() is returning without freeing the 'name' pointer. Added bail out to explicitly call kfree when necessary. Signed-off-by: Geyslan G. Bem --- fs/btrfs/tree-log.c | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/fs/btrfs/tree-log.c b/fs/b

Re: [Kernel-BR] [PATCH] btrfs: Fix memory leakage in the tree-log.c

2013-10-09 Thread Geyslan Gregório Bem
Felipe, thank you, Sending v2. Geyslan Gregório Bem hackingbits.com 2013/10/9 Felipe Pena : > Hi, > > On Wed, Oct 9, 2013 at 8:13 PM, Geyslan G. Bem wrote: >> In some cases, add_inode_ref() is returning without freeing >> the 'name' pointer. >> >> Added bail out to explicitly call kfree when n

[PATCH v2] btrfs: Fix memory leakage in the tree-log.c

2013-10-09 Thread Geyslan G. Bem
In some cases, add_inode_ref() is returning without freeing the 'name' pointer. Added bail out to explicitly call kfree when necessary. Signed-off-by: Geyslan G. Bem --- fs/btrfs/tree-log.c | 11 --- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/fs/btrfs/tree-log.c b/fs/

Re: [Kernel-BR] [PATCH] btrfs: Fix memory leakage in the tree-log.c

2013-10-09 Thread Felipe Pena
Hi, On Wed, Oct 9, 2013 at 8:13 PM, Geyslan G. Bem wrote: > In some cases, add_inode_ref() is returning without freeing > the 'name' pointer. > > Added bail out to explicitly call kfree when necessary. > > Signed-off-by: Geyslan G. Bem > --- > fs/btrfs/tree-log.c | 13 ++--- > 1 file ch

[PATCH] btrfs: Fix memory leakage in the tree-log.c

2013-10-09 Thread Geyslan G. Bem
In some cases, add_inode_ref() is returning without freeing the 'name' pointer. Added bail out to explicitly call kfree when necessary. Signed-off-by: Geyslan G. Bem --- fs/btrfs/tree-log.c | 13 ++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/fs/btrfs/tree-log.c b/

[PATCH] xfstests: btrfs/016: a regression test for subvolume rename

2013-10-09 Thread Josef Bacik
A user reported a regression where we could no longer rename a subvolume into another subvolume. This is a test case to do just that to make sure we don't regress on this again. Thanks, Signed-off-by: Josef Bacik --- tests/btrfs/016 | 61

Re: regression, can't move subvols into subvols

2013-10-09 Thread Josef Bacik
On Wed, Oct 09, 2013 at 11:17:43AM -0600, Chris Murphy wrote: > > On Oct 9, 2013, at 10:27 AM, Josef Bacik wrote: > > > On Tue, Oct 08, 2013 at 03:58:23PM -0600, Chris Murphy wrote: > >> I don't think this is expected, is it? I can no longer move a subvolume > >> into another subvolume. I can m

Re: regression, can't move subvols into subvols

2013-10-09 Thread Chris Murphy
On Oct 9, 2013, at 10:27 AM, Josef Bacik wrote: > On Tue, Oct 08, 2013 at 03:58:23PM -0600, Chris Murphy wrote: >> I don't think this is expected, is it? I can no longer move a subvolume into >> another subvolume. I can move a subvolume into a directory. This happens >> with 3.11.3, and 3.12 r

Re: [PATCH] Btrfs: use right root when checking for hash collision

2013-10-09 Thread Zach Brown
On Wed, Oct 09, 2013 at 12:26:42PM -0400, Josef Bacik wrote: > btrfs_rename was using the root of the old dir instead of the root of the new > dir when checking for a hash collision, so if you tried to move a file into a > subvol it would freak out because it would see the file you are trying to mo

Re: regression, can't move subvols into subvols

2013-10-09 Thread Josef Bacik
On Tue, Oct 08, 2013 at 03:58:23PM -0600, Chris Murphy wrote: > I don't think this is expected, is it? I can no longer move a subvolume into > another subvolume. I can move a subvolume into a directory. This happens with > 3.11.3, and 3.12 rc4. I'm not sure yet when the regression first appeared.

[PATCH] Btrfs: use right root when checking for hash collision

2013-10-09 Thread Josef Bacik
btrfs_rename was using the root of the old dir instead of the root of the new dir when checking for a hash collision, so if you tried to move a file into a subvol it would freak out because it would see the file you are trying to move in its current root. This fixes the bug where this would fail

[PATCH] Btrfs: add tests for find_lock_delalloc_range

2013-10-09 Thread Josef Bacik
So both Liu and I made huge messes of find_lock_delalloc_range trying to fix stuff, me first by fixing extent size, then him by fixing something I broke and then me again telling him to fix it a different way. So this is obviously a candidate for some testing. This patch adds a pseudo fs so we ca

Re: btrfsck --repair --init-extent-tree: segfault error 4

2013-10-09 Thread Martin
In summary: Looks like minimal damage remains and yet I'm still suffering "Input/output error" from btrfs and btrfsck appears to have looped... A diff check suggests the damage to be in one (heavily linked to) tree of a few MBytes. Would a scrub clear out the damaged trees? Worth debugging? T

Re: kernel BUG at fs/btrfs/relocation.c:2255!

2013-10-09 Thread Josef Bacik
On Wed, Oct 09, 2013 at 11:53:23PM +0800, Eryu Guan wrote: > Hi all, > > I hit a BUG_ON while playing with btrfs balance. Kernel is > 3.12-rc4. > > The reproducer is a script doing subvolume create/mount/umount/delete > in loop at back ground and do balance at the same time. > > It's reproducabl

kernel BUG at fs/btrfs/relocation.c:2255!

2013-10-09 Thread Eryu Guan
Hi all, I hit a BUG_ON while playing with btrfs balance. Kernel is 3.12-rc4. The reproducer is a script doing subvolume create/mount/umount/delete in loop at back ground and do balance at the same time. It's reproducable everytime. And seems like this is a regression, I cannot reproduce it on 3.

Re: [PATCH v2] btrfs-progs: calculate disk space that a subvol could free

2013-10-09 Thread Wang Shilong
Hello David, Anand, > On Mon, Oct 07, 2013 at 10:47:56AM +0800, Anand Jain wrote: >> I was also thinking if this should be inside kernel >> facilitated by a new ioctl? so that we avoid number >> of search ioctl thats required. > > I think so. And for the feature itself, it can be handy in case

Re: [PATCH] Btrfs: limit delalloc pages outside of find_delalloc_range

2013-10-09 Thread Liu Bo
On Wed, Oct 09, 2013 at 08:57:12AM -0400, Josef Bacik wrote: > On Wed, Oct 09, 2013 at 06:07:20PM +0800, Liu Bo wrote: > > On Tue, Oct 08, 2013 at 01:31:57PM -0400, Josef Bacik wrote: > > > Liu fixed part of this problem and unfortunately I steered him in > > > slightly the > > > wrong direction a

Re: [PATCH] Btrfs: limit delalloc pages outside of find_delalloc_range

2013-10-09 Thread Josef Bacik
On Wed, Oct 09, 2013 at 06:07:20PM +0800, Liu Bo wrote: > On Tue, Oct 08, 2013 at 01:31:57PM -0400, Josef Bacik wrote: > > Liu fixed part of this problem and unfortunately I steered him in slightly > > the > > wrong direction and so didn't completely fix the problem. The problem is we > > limit t

Re: [PATCH] Btrfs: limit delalloc pages outside of find_delalloc_range

2013-10-09 Thread Liu Bo
On Tue, Oct 08, 2013 at 01:31:57PM -0400, Josef Bacik wrote: > Liu fixed part of this problem and unfortunately I steered him in slightly the > wrong direction and so didn't completely fix the problem. The problem is we > limit the size of the delalloc range we are looking for to max bytes and the

Re: [PATCH v2] btrfs-progs: calculate disk space that a subvol could free

2013-10-09 Thread Wang Shilong
On 10/09/2013 04:03 PM, Anand Jain wrote: > Wang, > > >> 1. First to search inline extent_data >> 2. Secondly search in extent tree to calculate (extent refs=1) > but these extents will be of entire fs, how do you filter it for a subvol ? Sorry, this could not be true as i have expected,(we have to

Re: [PATCH v2] btrfs-progs: calculate disk space that a subvol could free

2013-10-09 Thread Anand Jain
Wang, > 1. First to search inline extent_data > 2. Secondly search in extent tree to calculate (extent refs=1) but these extents will be of entire fs, how do you filter it for a subvol ? Thanks, Anand > This will avoid n*n rather than n+n which is better… -- To unsubscribe from this list: se

Re: btrfs device delete problem

2013-10-09 Thread Alfredo Esteban
Thank a lot for your responses. I already knew degraded mount but I wanted to solve the problem in a consistent way and not continuing to mount in degraded mode. I tried to add another device and "btrfs device delete missing /mnt" but it failed. I also tried using balance filters and --force opti