Re: [PATCH 1/3] btrfs-progs: move out print in cmd_df to another function

2013-08-19 Thread Anand Jain
This seems to be a whole lot of code for a simple iterating printf: struct space_type_thingy_whatver *sp = sargs->spaces; for (i = 0; i < sargs->total_spaces; i++, sp++) { printf("%s, %s: total=%s, used=%s\n", group_type_str(sp->flags),

[PATCH] btrfs-progs: v3, move out print in cmd_df to another function

2013-08-19 Thread Anand Jain
This is a prepatory work for the following btrfs fi show command fixes. So that we have a function get_df to get the fs sizes v3: accepts Zach review comments v2: combined the other patches as below and rebase btrfs-progs: get string for the group profile and type Signed-off-by: Anand Jain ---

[PATCH] btrfs-progs: use btrfs error code for kernel errors

2013-08-19 Thread Anand Jain
Now with the below kernel patch, the excl operations like dev add/replace/resize and balance returns the btrfs error code defined in btrfs.h, this patch will help btrfs-progs (and thus user) to know the error string on the terminal (instead of /var/log/messages as previously kernel did). This patc

[PATCH] btrfs: return btrfs error code for dev excl ops err

2013-08-19 Thread Anand Jain
now threads can return BTRFS_ERROR_DEV_EXCL_RUN_IN_PROGRESS as defined in btrfs.h for the dev excl operation error in the FS, which means with this kernel would stop logging (almost an user error) into the /var/log/messages Signed-off-by: Anand Jain --- fs/btrfs/ioctl.c | 12

Re: Question: btrfs-progs releases?

2013-08-19 Thread Chris Mason
Quoting Eric Sandeen (2013-08-17 23:50:51) > On 8/17/13 10:25 PM, Tom Gundersen wrote: > > On Sat, Aug 17, 2013 at 7:59 PM, Chris Mason > > wrote: > >> The problem with the progs release is I keep finding more things I want > >> to add. My local git tree has about a dozen commits that I feel are

[PATCH v6] Btrfs: fix memory leak of orphan block rsv

2013-08-19 Thread Filipe David Borba Manana
This issue is simple to reproduce and observe if kmemleak is enabled. Two simple ways to reproduce it: ** 1 $ mkfs.btrfs -f /dev/loop0 $ mount /dev/loop0 /mnt/btrfs $ btrfs balance start /mnt/btrfs $ umount /mnt/btrfs ** 2 $ mkfs.btrfs -f /dev/loop0 $ mount /dev/loop0 /mnt/btrfs $ touch /mnt/bt

BUG at fs/btrfs/relocation.c:1055 during balance.

2013-08-19 Thread Lutz Euler
Hi, during a balance I got the BUG from the subject line, followed by BUG: unable to handle kernel paging request at 0008a940. The machine needed to be rebooted afterwards; the filesystem was successfully mounted and the balance resumed and finished successfully. I then ran scrub which fou

[PATCH] xfstests: add regression test for kernel bz 60673 V2

2013-08-19 Thread Josef Bacik
There was a problem with send trying to overwrite a file that wasn't actually the same. This is a test to check this particular case where receive fails when it should succeed properly. I tested this to verify it fails without my fix and passes with my fix. Thanks, Signed-off-by: Josef Bacik -

Re: Cloning a Btrfs partition

2013-08-19 Thread BJ Quinn
Ok, so the fix is now in 3.10.6 and I'm using that. I don't get the hang anymore, but now I'm having a new problem. Mount options -- rw,noatime,nodiratime,compress-force=zlib,space_cache,inode_cache,ssd I need compression because I get a very high compression ratio with my data and I have lots

Re: [PATCH] xfstests: btrfs/009 never shrinked or removed $seqres.full

2013-08-19 Thread Rich Johnston
Thanks for the patch Stefan, it has been committed. --Rich commit 6bd8df93fa6b7d9ce402f9c665e5971106df7843 Author: Stefan Behrens Date: Fri Aug 16 17:44:54 2013 + xfstests: btrfs/009 never shrinked or removed $seqres.full Signed-off-by: Stefan Behrens Reviewed-by: Eric Sand

[PATCH v5] Btrfs: fix memory leak of orphan block rsv

2013-08-19 Thread Filipe David Borba Manana
This issue is simple to reproduce and observe if kmemleak is enabled. Two simple ways to reproduce it: ** 1 $ mkfs.btrfs -f /dev/loop0 $ mount /dev/loop0 /mnt/btrfs $ btrfs balance start /mnt/btrfs $ umount /mnt/btrfs ** 2 $ mkfs.btrfs -f /dev/loop0 $ mount /dev/loop0 /mnt/btrfs $ touch /mnt/bt

[PATCH v4] Btrfs: fix memory leak of orphan block rsv

2013-08-19 Thread Filipe David Borba Manana
This issue is simple to reproduce and observe if kmemleak is enabled. Two simple ways to reproduce it: ** 1 $ mkfs.btrfs -f /dev/loop0 $ mount /dev/loop0 /mnt/btrfs $ btrfs balance start /mnt/btrfs $ umount /mnt/btrfs ** 2 $ mkfs.btrfs -f /dev/loop0 $ mount /dev/loop0 /mnt/btrfs $ touch /mnt/bt

[PATCH v3] Btrfs: fix memory leak of orphan block rsv

2013-08-19 Thread Filipe David Borba Manana
This issue is simple to reproduce and observe if kmemleak is enabled. Two simple ways to reproduce it: ** 1 $ mkfs.btrfs -f /dev/loop0 $ mount /dev/loop0 /mnt/btrfs $ btrfs balance start /mnt/btrfs $ umount /mnt/btrfs ** 2 $ mkfs.btrfs -f /dev/loop0 $ mount /dev/loop0 /mnt/btrfs $ touch /mnt/bt

Re: [PATCH 1/3] btrfs-progs: move out print in cmd_df to another function

2013-08-19 Thread Zach Brown
> +static void print_df(struct btrfs_ioctl_space_args *sargs) > +{ > + char description[80]; > + char *total_bytes; > + char *used_bytes; > + u64 flags; > + u64 i; > + int written; > + char g_str[64]; > + int g_sz; > > + for (i = 0; i < sargs->total_spaces; i++

Re: [PATCH] Btrfs: fix some basic sparse errors

2013-08-19 Thread Josef Bacik
On Mon, Aug 19, 2013 at 08:47:21PM +0200, Stefan Behrens wrote: > On 08/19/2013 20:21, Josef Bacik wrote: > >Running sparse I found a few small things where we should have static > >functions > >that aren't used externally and we should be using unsigned values for bit > >fields. Thanks, > > > >S

Re: [PATCH] Btrfs: fix some basic sparse errors

2013-08-19 Thread Stefan Behrens
On 08/19/2013 20:21, Josef Bacik wrote: Running sparse I found a few small things where we should have static functions that aren't used externally and we should be using unsigned values for bit fields. Thanks, Signed-off-by: Josef Bacik --- fs/btrfs/disk-io.c |8 fs/btrfs/send

[PATCH v2] Btrfs: fix memory leak of orphan block rsv

2013-08-19 Thread Filipe David Borba Manana
When adding orphans to an inode's root, we start a transaction for that root that when ended in several places such as for example extent-tree.c:btrfs_remove_block_group(), inode.c:btrfs_unlink() and inode.c:btrfs_evict_node(), doesn't result in a commit, that is, inode.c:btrfs_orphan_commit_root()

[PATCH] Btrfs: fix some basic sparse errors

2013-08-19 Thread Josef Bacik
Running sparse I found a few small things where we should have static functions that aren't used externally and we should be using unsigned values for bit fields. Thanks, Signed-off-by: Josef Bacik --- fs/btrfs/disk-io.c |8 fs/btrfs/send.c|4 ++-- 2 files changed, 6 insert

[RFC PATCH] Btrfs: fix memory leak of orphan block rsv

2013-08-19 Thread Filipe David Borba Manana
When adding orphans to an inode's root, we start a transaction for that root that when ended in several places such as for example extent-tree.c:btrfs_remove_block_group(), inode.c:btrfs_unlink() and inode.c:btrfs_evict_node(), doesn't result in a commit, that is, inode.c:btrfs_orphan_commit_root()

[PATCH] Btrfs-progs: allow fsck to fix directory isize errors

2013-08-19 Thread Josef Bacik
A user reported a problem where he was unable to rmdir an empty directory. This is because his isize was wrong. This patch will fix this sort of corruption and allow him to rmdir his directory. Thanks Signed-off-by: Josef Bacik --- cmds-check.c | 86 +

[PATCH] Btrfs: don't allow the replace procedure on read only filesystems

2013-08-19 Thread Stefan Behrens
If you start the replace procedure on a read only filesystem, at the end the procedure fails to write the updated dev_items to the chunk tree. The problem is that this error is not indicated except for a WARN_ON(). If the user now thinks that everything was done as expected and destroys the source

[PATCH] Btrfs-progs: setup framework to corrupt specific fields of an inode

2013-08-19 Thread Josef Bacik
A user reported a problem with his fs where he had a bogus isize on his directory. In order to make sure my patch for fsck fixes this properly I needed to be able to corrupt an inode like this, which is what this patch is for. Eventually I want to extend this to corrupt everything so we can integr

[PATCH V4] xfstests: add a test for btrfs device replace operation

2013-08-19 Thread Stefan Behrens
This test performs btrfs device replace tests with all possible profiles (single/dup/mixed/raid0/raid1/raid10), one round with the '-r' option to 'btrfs replace start' and one round without this option. The cancelation is tested only once and with the dup/single profile for metadata/data. This tes

Re: [PATCH] Btrfs: fix heavy delalloc related deadlock

2013-08-19 Thread Josef Bacik
On Mon, Aug 19, 2013 at 10:31:15AM +0800, Miao Xie wrote: > On wed, 14 Aug 2013 11:41:00 -0400, Josef Bacik wrote: > > I added a patch where we started taking the ordered operations mutex when we > > waited on ordered extents. We need this because we splice the list and > > process > > it, so if

[PATCH V3] xfstests: add a test for btrfs device replace operation

2013-08-19 Thread Stefan Behrens
This test performs btrfs device replace tests with all possible profiles (single/dup/mixed/raid0/raid1/raid10), one round with the '-r' option to 'btrfs replace start' and one round without this option. The cancelation is tested only once and with the dup/single profile for metadata/data. This tes

Extreme performance loss since 3.9

2013-08-19 Thread Kai Krakow
Hello list! During 3.9 I had dead-lock problems with autodefrag. The system either froze or showed some kernel oopses randomly while working with the system. So I turned off autodefrag and the problem was cured. But that radically slowed my system down over time. My desktop programs now take a

[PATCH V3] xfstests: don't remove the two first devices from SCRATCH_DEV_POOL

2013-08-19 Thread Stefan Behrens
Since common/config is executed twice, if SCRATCH_DEV_POOL is configured via the environment, the current code removes the first device entry twice which means that you lose the second device for the test. The fix is to not remove anything from SCRATCH_DEV_POOL anymore. That used to be done (I can

[PATCH V2] xfstests: don't remove the two first devices from SCRATCH_DEV_POOL

2013-08-19 Thread Stefan Behrens
Since common/config is executed twice, if SCRATCH_DEV_POOL is configured via the environment, the current code removes the first device entry twice which means that you lose the second device for the test. The fix is to not remove anything from SCRATCH_DEV_POOL anymore. That used to be done (I can