Re: [PATCH 2/2] btrfs-progs: mark static & remove unused from non-kernel code

2013-08-07 Thread Stefan Behrens
On Tue, 06 Aug 2013 22:49:32 -0500, Eric Sandeen wrote: > On 8/6/13 8:05 PM, Eric Sandeen wrote: >> Mark many functions as static, and remove any resulting dead code. >> >> Signed-off-by: Eric Sandeen >> --- > ... > > Actually, what the heck was this (note, this patch was against kdave's > integ

Re: Heavy memory leak when using quota groups

2013-08-07 Thread Tomasz Chmielewski
On Wed, 7 Aug 2013 00:42:27 +0800 Tomasz Chmielewski wrote: > > What do I have to do to reproduce it here? How do you generate the > > load? What is the disk setup, what the qgroups setup? > > Unfortunately I don't have a way to reproduce, as the issue > happened to me only once. I keep removin

[patch v2 resend 4/8] Btrfs-progs: add man page information for btrfs-find-root

2013-08-07 Thread Wang Shilong
Signed-off-by: Wang Shilong Signed-off-by: Qu Wenruo --- V1->V2: GPLv3->GPLv2 Thanks to Stefan Behrens --- man/Makefile | 2 +- man/btrfs-find-root.8.in | 36 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 man/btrfs-find-roo

Re: [v2 4/8] Btrfs-progs: add man page information for btrfs-find-root

2013-08-07 Thread Wang Shilong
many thanks to Stefan,you are always so helpful.~_~ David, please ignore this patch, i will resend. Thanks, Wang On 08/07/2013 02:46 PM, Stefan Behrens wrote: > On Wed, 7 Aug 2013 13:54:05 +0800, Wang Shilong wrote: >> --- >> V1->V2: GPLv3->GPLv2 >> --- > > [...] >> .SH COPYRIGHT >> Copyright

Re: [PATCH RFC] Btrfs: add support for persistent mount options

2013-08-07 Thread David Sterba
On Tue, Aug 06, 2013 at 07:27:20PM +0100, Filipe David Borba Manana wrote: > This change allows for most mount options to be persisted in > the filesystem, and be applied when the filesystem is mounted. > If the same options are specified at mount time, the persisted > values for those options are

Re: [PATCH RFC] Btrfs: add support for persistent mount options

2013-08-07 Thread David Sterba
On Tue, Aug 06, 2013 at 04:05:50PM -0500, Eric Sandeen wrote: > I was thinking (and Josef just suggested too) that making a > dir flag, saying "everything under this dir gets compressed" might make > more sense for that scenario than adding a whole slew of > on-disk-persistent-mount-option code. W

Re: [PATCH 1/2] btrfs-progs: introduce command namespace for development features

2013-08-07 Thread David Sterba
On Tue, Aug 06, 2013 at 11:01:37AM -0700, Zach Brown wrote: > My biggest worry about this is that it complicates the coordination of > automated testing, which is already in a terrible state for btrfs-progs. > It can't possibly motivate people to write tests if we make the process > more cumbersome

[PATCH RFC] Btrfs: track compression algorithm on inodes

2013-08-07 Thread Filipe David Borba Manana
Currently the compression settings (algorithm and force mode) need to be specified at mount time in order to have newly created files compressed. If we mount a filesystem with the compress=lzo option for example, create a directory, add the +c attribute to that directory, unmount the file system, m

Re: [PATCH RFC] Btrfs: add support for persistent mount options

2013-08-07 Thread Filipe David Manana
On Wed, Aug 7, 2013 at 11:48 AM, David Sterba wrote: > On Tue, Aug 06, 2013 at 04:05:50PM -0500, Eric Sandeen wrote: >> I was thinking (and Josef just suggested too) that making a >> dir flag, saying "everything under this dir gets compressed" might make >> more sense for that scenario than adding

Re: [PATCH RFC] Btrfs: add support for persistent mount options

2013-08-07 Thread Filipe David Manana
On Wed, Aug 7, 2013 at 11:40 AM, David Sterba wrote: > On Tue, Aug 06, 2013 at 07:27:20PM +0100, Filipe David Borba Manana wrote: >> This change allows for most mount options to be persisted in >> the filesystem, and be applied when the filesystem is mounted. >> If the same options are specified a

[PATCH 2/3] btrfs-progs: cmd_start_replace() to use test_dev_for_mkfs()

2013-08-07 Thread Anand Jain
test_dev_for_mkfs() is a common place where we check if a device is fit for the btrfs use. cmd_start_replace() should make use of test_dev_for_mkfs(), and here the test_dev_for_mkfs() is further enhanced to fit the cmd_start_replace() needs. Thanks Signed-off-by: Anand Jain --- cmds-replace.c |

[PATCH 3/3] btrfs-progs: avoid write to the disk before sure to create fs

2013-08-07 Thread Anand Jain
This patch provides fix for the following bug, When mkfs.btrfs fails the disks shouldn't be written. btrfs fi show /dev/sdb Label: none uuid: 60fb76f4-3b4d-4632-a7da-6a44dea5573d Total devices 1 FS bytes used 24.00KiB devid1 size 2.00GiB used 20.00MiB path /dev/sd

[PATCH 1/3] btrfs-progs: let user know that devid can be used if path is missing

2013-08-07 Thread Anand Jain
When the device disappear the path goes missing, and that will be the one of the reason that user will replace the device. The devid of the missing btrfs device can be obtained using the new cli option btrfs fi show --kernel (coming soon) And which can be used in the replace command. --- cmds-r

[PATCH 0/3 resend]

2013-08-07 Thread Anand Jain
Anand Jain (3): btrfs-progs: let user know that devid can be used if path is missing btrfs-progs: cmd_start_replace() to use test_dev_for_mkfs() btrfs-progs: avoid write to the disk before sure to create fs cmds-replace.c | 33 +++--- mkfs.c | 104

Re: [PATCH 1/2] btrfs-progs: introduce command namespace for development features

2013-08-07 Thread David Sterba
On Wed, Aug 07, 2013 at 01:26:58PM +0200, David Sterba wrote: > I have to re-organize integration branch(es) better, so there is eg. a > branch without unstable stuff, possibly always in a pullable state. On > top of that a bunch of topic branches with the _ features. ... but then there's no point

Re: [PATCH RFC] Btrfs: add support for persistent mount options

2013-08-07 Thread Martin Steigerwald
Am Dienstag, 6. August 2013, 16:05:50 schrieb Eric Sandeen: > On 8/6/13 3:45 PM, Filipe David Manana wrote: > > On Tue, Aug 6, 2013 at 9:37 PM, Eric Sandeen wrote: > >> On 8/6/13 1:27 PM, Filipe David Borba Manana wrote: > >>> This change allows for most mount options to be persisted in > >>> the

Re: [PATCH 2/2] btrfs-progs: mark static & remove unused from non-kernel code

2013-08-07 Thread Eric Sandeen
On 8/7/13 2:54 AM, Stefan Behrens wrote: > On Tue, 06 Aug 2013 22:49:32 -0500, Eric Sandeen wrote: >> On 8/6/13 8:05 PM, Eric Sandeen wrote: >>> Mark many functions as static, and remove any resulting dead code. >>> >>> Signed-off-by: Eric Sandeen >>> --- >> ... >> >> Actually, what the heck was t

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

2013-08-07 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: [PATCH 1/2] btrfs-progs: introduce command namespace for development features

2013-08-07 Thread Zach Brown
On Wed, Aug 07, 2013 at 02:38:12PM +0200, David Sterba wrote: > On Wed, Aug 07, 2013 at 01:26:58PM +0200, David Sterba wrote: > > I have to re-organize integration branch(es) better, so there is eg. a > > branch without unstable stuff, possibly always in a pullable state. On > > top of that a bunch

btrfs filesystem "hang" after page allocation failure: order:0 + kernel BUG at fs/btrfs/extent_io.c:4151

2013-08-07 Thread Tomasz Chmielewski
One of btrfs filesystems hanged on my server. By "hang", I mean it's not possible to finish any write operation, i.e.: # cd /mnt/btrfs # ls some-file # touch 1 [it never returns to shell here] There are the following processes in "D" state: root 2397 0.6 0.0 0 0 ?D

Re: btrfs filesystem "hang" after page allocation failure: order:0 + kernel BUG at fs/btrfs/extent_io.c:4151

2013-08-07 Thread Zach Brown
On Thu, Aug 08, 2013 at 02:17:05AM +0800, Tomasz Chmielewski wrote: > One of btrfs filesystems hanged on my server. Yeah, that's the consequence of using BUG_ON() for error handling. It forcefully tears down the task that executes it without returning back up the stack. Any locks that are held b

[PATCH] Btrfs: deal with enomem in the rewind path

2013-08-07 Thread Josef Bacik
We can get ENOMEM trying to allocate dummy bufs for the rewind operation of the tree mod log. Instead of BUG_ON()'ing in this case pass up ENOMEM. I looked back through the callers and I'm pretty sure I got everybody who did BUG_ON(ret) in this path. Thanks, Signed-off-by: Josef Bacik --- fs/

Re: btrfs filesystem "hang" after page allocation failure: order:0 + kernel BUG at fs/btrfs/extent_io.c:4151

2013-08-07 Thread Josef Bacik
On Thu, Aug 08, 2013 at 02:17:05AM +0800, Tomasz Chmielewski wrote: > One of btrfs filesystems hanged on my server. > > By "hang", I mean it's not possible to finish any write operation, i.e.: > > # cd /mnt/btrfs > > # ls > some-file > > # touch 1 > [it never returns to shell here] > I've jus

Re: btrfs filesystem "hang" after page allocation failure: order:0 + kernel BUG at fs/btrfs/extent_io.c:4151

2013-08-07 Thread Tomasz Chmielewski
On Wed, 7 Aug 2013 14:57:04 -0400 Josef Bacik wrote: > > One of btrfs filesystems hanged on my server. > > > > By "hang", I mean it's not possible to finish any write operation, > > i.e.: > > > > # cd /mnt/btrfs > > > > # ls > > some-file > > > > # touch 1 > > [it never returns to shell here]

[PATCH] Btrfs: deal with enomem in the rewind path V2

2013-08-07 Thread Josef Bacik
We can get ENOMEM trying to allocate dummy bufs for the rewind operation of the tree mod log. Instead of BUG_ON()'ing in this case pass up ENOMEM. I looked back through the callers and I'm pretty sure I got everybody who did BUG_ON(ret) in this path. Thanks, Signed-off-by: Josef Bacik --- V1->

[PATCH][RESEND] vfs: allow /proc/PID/maps to get device from stat

2013-08-07 Thread Mark Fasheh
stat(2) on btrfs returns a custom device, but proc uses s_dev from the super block. This causes problems (abi breakage) because software (and users) are not expecting the kernel to return different devices from these calls. This patch fixes the problem by adding a new superblock flag, MS_STAT_FOR_

Re: [PATCH] Btrfs: deal with enomem in the rewind path V2

2013-08-07 Thread Zach Brown
> --- a/fs/btrfs/ctree.c > +++ b/fs/btrfs/ctree.c > @@ -1211,7 +1211,8 @@ tree_mod_log_rewind(struct btrfs_fs_info *fs_info, > struct extent_buffer *eb, > BUG_ON(tm->slot != 0); > eb_rewin = alloc_dummy_extent_buffer(eb->start, >

Re: [PATCH] Btrfs: deal with enomem in the rewind path V2

2013-08-07 Thread Josef Bacik
On Wed, Aug 07, 2013 at 01:02:30PM -0700, Zach Brown wrote: > > --- a/fs/btrfs/ctree.c > > +++ b/fs/btrfs/ctree.c > > @@ -1211,7 +1211,8 @@ tree_mod_log_rewind(struct btrfs_fs_info *fs_info, > > struct extent_buffer *eb, > > BUG_ON(tm->slot != 0); > > eb_rewin = alloc_dummy

Re: [PATCH][RESEND] vfs: allow /proc/PID/maps to get device from stat

2013-08-07 Thread Christoph Hellwig
On Wed, Aug 07, 2013 at 12:57:18PM -0700, Mark Fasheh wrote: > stat(2) on btrfs returns a custom device, but proc uses s_dev from the super > block. This causes problems (abi breakage) because software (and users) are > not expecting the kernel to return different devices from these calls. So fix

Re: [PATCH][RESEND] vfs: allow /proc/PID/maps to get device from stat

2013-08-07 Thread Josef Bacik
On Wed, Aug 07, 2013 at 01:18:26PM -0700, Christoph Hellwig wrote: > On Wed, Aug 07, 2013 at 12:57:18PM -0700, Mark Fasheh wrote: > > stat(2) on btrfs returns a custom device, but proc uses s_dev from the super > > block. This causes problems (abi breakage) because software (and users) are > > not

[PATCH] Btrfs: deal with enomem in the rewind path V3

2013-08-07 Thread Josef Bacik
We can get ENOMEM trying to allocate dummy bufs for the rewind operation of the tree mod log. Instead of BUG_ON()'ing in this case pass up ENOMEM. I looked back through the callers and I'm pretty sure I got everybody who did BUG_ON(ret) in this path. Thanks, Signed-off-by: Josef Bacik --- V2->

[PATCH] Btrfs: stop using GFP_ATOMIC when allocating rewind ebs

2013-08-07 Thread Josef Bacik
There is no reason we can't just set the path to blocking and then do normal GFP_NOFS allocations for these extent buffers. Thanks, Signed-off-by: Josef Bacik --- fs/btrfs/ctree.c | 16 ++-- fs/btrfs/extent_io.c |8 2 files changed, 14 insertions(+), 10 deletions(

[PATCH 2/7] btrfs: cleanup: mark 'set_state_private' as static

2013-08-07 Thread Sergei Trofimovich
From: Sergei Trofimovich Found by uselex.rb: > set_state_private: [R]: exported from: fs/btrfs/disk-io.o fs/btrfs/built-in.o > fs/btrfs/btrfs.o Signed-off-by: Sergei Trofimovich --- fs/btrfs/extent_io.c | 2 +- fs/btrfs/extent_io.h | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff

[PATCH 0/7] uselex.rb as a tiny tool to find dead code

2013-08-07 Thread Sergei Trofimovich
From: Sergei Trofimovich Hi guys! TL;DR: the patches remove (currently or already) dead code and localize symbol visibility used only in one module. Thanks! The Story: Once upon a time I've got very simple idea to find dead code in large C/C++ mixed project at work. The things of my primary

[PATCH 1/7] btrfs: cleanup: mark 'btrfs_lookup_fs_root' as static

2013-08-07 Thread Sergei Trofimovich
From: Sergei Trofimovich Found by uselex.rb: > btrfs_lookup_fs_root: [R]: exported from: fs/btrfs/disk-io.o > fs/btrfs/built-in.o fs/btrfs/btrfs.o Signed-off-by: Sergei Trofimovich --- fs/btrfs/disk-io.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/btrfs/disk-io.

[PATCH 7/7] btrfs: cleanup: removed unused 'btrfs_get_inode_ref_index'

2013-08-07 Thread Sergei Trofimovich
From: Sergei Trofimovich Found by uselex.rb: > btrfs_get_inode_ref_index: [R]: exported from: fs/btrfs/inode-item.o > fs/btrfs/btrfs.o fs/btrfs/built-in.o Signed-off-by: Sergei Trofimovich --- fs/btrfs/ctree.h | 6 - fs/btrfs/inode-item.c | 65 ---

[PATCH 4/7] btrfs: cleanup: removed unused 'btrfs_start_transaction_lflush'

2013-08-07 Thread Sergei Trofimovich
From: Sergei Trofimovich Found by uselex.rb: > btrfs_start_transaction_lflush: [R]: exported from: fs/btrfs/btrfs.o > fs/btrfs/transaction.o fs/btrfs/built-in.o Signed-off-by: Sergei Trofimovich --- fs/btrfs/transaction.c | 7 --- fs/btrfs/transaction.h | 2 -- 2 files changed, 9 deletion

[PATCH 3/7] btrfs: cleanup: mark 'btrfs_write_and_wait_marked_extents' as static

2013-08-07 Thread Sergei Trofimovich
From: Sergei Trofimovich Found by uselex.rb: > btrfs_write_and_wait_marked_extents: [R]: exported from: fs/btrfs/btrfs.o > fs/btrfs/transaction.o fs/btrfs/built-in.o Signed-off-by: Sergei Trofimovich --- fs/btrfs/transaction.c | 4 ++-- fs/btrfs/transaction.h | 2 -- 2 files changed, 2 insert

[PATCH 5/7] btrfs: cleanup: mark 'btrfs_read_root_item' as static

2013-08-07 Thread Sergei Trofimovich
From: Sergei Trofimovich Found by uselex.rb: > btrfs_read_root_item: [R]: exported from: fs/btrfs/btrfs.o > fs/btrfs/built-in.o fs/btrfs/root-tree.o Signed-off-by: Sergei Trofimovich --- fs/btrfs/ctree.h | 2 -- fs/btrfs/root-tree.c | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(

[PATCH 6/7] btrfs: cleanup: removed unused 'btrfs_reada_detach'

2013-08-07 Thread Sergei Trofimovich
From: Sergei Trofimovich Found by uselex.rb: > btrfs_reada_detach: [R]: exported from: fs/btrfs/btrfs.o fs/btrfs/built-in.o > fs/btrfs/reada.o Signed-off-by: Sergei Trofimovich --- fs/btrfs/ctree.h | 1 - fs/btrfs/reada.c | 9 + 2 files changed, 1 insertion(+), 9 deletions(-) diff --

Re: [PATCH 0/7] uselex.rb as a tiny tool to find dead code

2013-08-07 Thread Eric Sandeen
On 8/7/13 4:43 PM, Sergei Trofimovich wrote: ... > Meet uselex.rb: one-file script to parse 'nm' output: > > https://github.com/trofi/uselex/blob/master/uselex.rb Nice to meet you! I think I've met your close relative, ftp://ftp.samba.org/pub/unpacked/junkcode/findstatic.pl :) #!/usr/bin

Re: [PATCH 0/7] uselex.rb as a tiny tool to find dead code

2013-08-07 Thread Sergei Trofimovich
On Wed, 07 Aug 2013 17:02:23 -0500 Eric Sandeen wrote: > On 8/7/13 4:43 PM, Sergei Trofimovich wrote: > > ... > > > Meet uselex.rb: one-file script to parse 'nm' output: > > > > https://github.com/trofi/uselex/blob/master/uselex.rb > > Nice to meet you! I think I've met your close relati

[PATCH] Btrfs-progs: add manpage of btrfs-image -m option

2013-08-07 Thread Liu Bo
There is a lack of manpage of btrfs-image '-m' option. Signed-off-by: Liu Bo --- btrfs-image.c|1 + man/btrfs-image.8.in |4 2 files changed, 5 insertions(+), 0 deletions(-) diff --git a/btrfs-image.c b/btrfs-image.c index 82aa4f3..862f081 100644 --- a/btrfs-image.c +++ b/b

Re: Heavy memory leak when using quota groups

2013-08-07 Thread Jérôme Poulin
I'm pretty I encountered the same leak over here, 15 days uptime and I had consistent out of memory problems, I got angry and did go in single user mode and noticed that with only systemd->screen->bash(2) I had 2 GB of memory used on 4 GB total. This box mostly has random reads and just before the

[PATCH 2/3] Btrfs: catch error return value from find_extent_in_eb()

2013-08-07 Thread Wang Shilong
find_extent_in_eb() may return ENOMEM, catch this error return value. Signed-off-by: Wang Shilong Reviewed-by: Miao Xie --- fs/btrfs/backref.c | 4 1 file changed, 4 insertions(+) diff --git a/fs/btrfs/backref.c b/fs/btrfs/backref.c index 54e7610..f7781e6 100644 --- a/fs/btrfs/backref.c +

[PATCH 1/3] Btrfs: fix possible memory leak in find_parent_nodes()

2013-08-07 Thread Wang Shilong
Signed-off-by: Wang Shilong Reviewed-by: Miao Xie --- fs/btrfs/backref.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/btrfs/backref.c b/fs/btrfs/backref.c index cb73a12..54e7610 100644 --- a/fs/btrfs/backref.c +++ b/fs/btrfs/backref.c @@ -911,7 +911,6 @@ again:

[PATCH 3/3] Btrfs: allocate prelim_ref with a slab allocater

2013-08-07 Thread Wang Shilong
struct __prelim_ref is allocated and freed frequently when walking backref tree, using slab allocater can not only speed up allocating but also detect memory leaks. Signed-off-by: Wang Shilong Reviewed-by: Miao Xie --- fs/btrfs/backref.c | 30 +- fs/btrfs/backref.h |

Re: [PATCH 1/3] Btrfs: fix possible memory leak in find_parent_nodes()

2013-08-07 Thread Liu Bo
On Thu, Aug 08, 2013 at 01:04:17PM +0800, Wang Shilong wrote: > Signed-off-by: Wang Shilong > Reviewed-by: Miao Xie Sorry, I don't think I understand why it's a memory leak, some explanation is needed here. -liubo > --- > fs/btrfs/backref.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion

Re: [PATCH 1/3] Btrfs: fix possible memory leak in find_parent_nodes()

2013-08-07 Thread Liu Bo
On Thu, Aug 08, 2013 at 01:04:17PM +0800, Wang Shilong wrote: > Signed-off-by: Wang Shilong > Reviewed-by: Miao Xie I think I know the whys :p, but still a log is preferred. -liubo > --- > fs/btrfs/backref.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/fs/btrfs/ba

Re: [PATCH 1/3] Btrfs: fix possible memory leak in find_parent_nodes()

2013-08-07 Thread Miao Xie
On thu, 8 Aug 2013 13:22:12 +0800, Liu Bo wrote: > On Thu, Aug 08, 2013 at 01:04:17PM +0800, Wang Shilong wrote: >> Signed-off-by: Wang Shilong >> Reviewed-by: Miao Xie > > I think I know the whys :p, but still a log is preferred. Right, we need a explanation, we will update this patch soon. T

[PATCH] _test_generic_punch: Extend $testfile's size to work with 64k block.

2013-08-07 Thread chandan
>From cf6e1fc3a8d7806a97055b5f483cf50f58c8294f Mon Sep 17 00:00:00 2001 From: chandan Date: Thu, 8 Aug 2013 11:33:10 +0530 Subject: [PATCH] _test_generic_punch: Extend $testfile's size to work with 64k block. The current script does not work with 64k block size. This patch fixes it by creating a