Re: [PATCH] Btrfs: complete page writeback before doing ordered extents

2012-04-25 Thread Liu Bo
On 04/24/2012 10:15 PM, Chris Mason wrote: > On Tue, Apr 24, 2012 at 09:50:39AM +0800, Liu Bo wrote: >> On 04/24/2012 01:33 AM, Josef Bacik wrote: >> >>> We can deadlock waiting for pages to end writeback because we are doing an >>> allocation while hold a tree lock since the ordered extent stuff

Re: [btrfs-progs] [bug][patch] Leaking file handle in scrub_fs_info()

2012-04-25 Thread Jan Schmidt
Hi Goffredo, On 24.04.2012 20:43, Goffredo Baroncelli wrote: > I was giving a look to the function scrub_fs_info( ), and to me it seems > that could be a potential file handle leaking problem. It's only a single fd that's closed upon exit, but anyway... > In fact: > > static int scrub_fs_info(i

Re: [PATCH 1/3] btrfs: extended inode refs

2012-04-25 Thread Jan Schmidt
On 25.04.2012 00:23, Mark Fasheh wrote: > Jan, firstly thanks very much for the thorough review! I wanted to make sure > I got the collision handling going before addressing the issues you found. > Again thanks, and my notes are below. > On Thu, Apr 12, 2012 at 03:08:27PM +0200, Jan Schmidt wrot

[PATCH] Btrfs: fix repair code for RAID10

2012-04-25 Thread Jan Schmidt
btrfs_map_block sets mirror_num, so that the repair code knows eventually which device gave us the read error. For RAID10, mirror_num must be 1 or 2. Before this fix mirror_num was incorrectly related to our stripe index. Signed-off-by: Jan Schmidt --- fs/btrfs/volumes.c |3 ++- 1 files chan

[PATCH] Add missing unlocks on error paths

2012-04-25 Thread Daniel J Blueman
Correctly drop locks during error cases. Signed-off-by: Daniel J Blueman --- fs/btrfs/transaction.c |7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c index 11b77a5..ede3988 100644 --- a/fs/btrfs/transaction.c +++ b/fs/btr

[PATCH] Fix minor type issues

2012-04-25 Thread Daniel J Blueman
Address some minor type issues identified by sparse checker. Signed-off-by: Daniel J Blueman --- fs/btrfs/ioctl.c |2 +- fs/btrfs/ulist.c |4 ++-- fs/btrfs/ulist.h |5 ++--- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index 18cc2

Re: [PATCH] Add missing unlocks on error paths

2012-04-25 Thread Josef Bacik
On Thu, Apr 26, 2012 at 12:04:51AM +0800, Daniel J Blueman wrote: > Correctly drop locks during error cases. > > Signed-off-by: Daniel J Blueman > --- > fs/btrfs/transaction.c |7 ++- > 1 file changed, 6 insertions(+), 1 deletion(-) > > diff --git a/fs/btrfs/transaction.c b/fs/btrfs/tra

Re: [PATCH] Fix minor type issues

2012-04-25 Thread Josef Bacik
On Thu, Apr 26, 2012 at 12:37:14AM +0800, Daniel J Blueman wrote: > Address some minor type issues identified by sparse checker. > > Signed-off-by: Daniel J Blueman > --- > fs/btrfs/ioctl.c |2 +- > fs/btrfs/ulist.c |4 ++-- > fs/btrfs/ulist.h |5 ++--- > 3 files changed, 5 insertion

[PATCH] Btrfs-progs: make btrfs filesystem show actually work

2012-04-25 Thread Josef Bacik
The btrfs filesystem show command is only actually searching for labels, it's not searching for UUID's at all. This patch fixes that problem. Thanks, Signed-off-by: Josef Bacik --- cmds-filesystem.c |7 +++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/cmds-filesystem.c

Re: [btrfs-progs] [bug][patch] Leaking file handle in scrub_fs_info()

2012-04-25 Thread Goffredo Baroncelli
On 04/25/2012 11:39 AM, Jan Schmidt wrote: > Hi Goffredo, > > On 24.04.2012 20:43, Goffredo Baroncelli wrote: >> I was giving a look to the function scrub_fs_info( ), and to me it seems >> that could be a potential file handle leaking problem. > > It's only a single fd that's closed upon exit, bu

Re: [PATCH] Add missing unlocks on error paths

2012-04-25 Thread David Sterba
On Thu, Apr 26, 2012 at 12:04:51AM +0800, Daniel J Blueman wrote: > Correctly drop locks during error cases. > > Signed-off-by: Daniel J Blueman > --- fyi, the same patch is already present in for-linus, 871383be592ba7e819d27556591e315a0df38cee [http://www.spinics.net/lists/linux-btrfs/msg15837.

Interpreting Output of "btrfs fi show"

2012-04-25 Thread Thomas Rohwer
Hello, I am using btrfs as my root file system on partition sda1. Now I am getting errors because of a full device, although df shows a use of only 64%. I read the FAQ and understand that this number may not be accurate. But according to the FAQ "btrfs fi show" should show a full device. I am g

[PATCH 1/4] vfs: introduce try_to_writeback_inodes_sb(_nr)

2012-04-25 Thread Miao Xie
writeback_inodes_sb(_nr) grabs s_umount lock when it want to start writeback, it may bring us deadlock problem when doing umount. So we introduce new functions -- try_to_writeback_inodes_sb(_nr) -- which use down_read_trylock() instead of down_read() to avoid that deadlock problem. This idea came

[PATCH 2/4] Btrfs: fix deadlock on sb->s_umount when doing umount

2012-04-25 Thread Miao Xie
The reason the deadlock is that: Task Btrfs-cleaner umount() down_write(&s->s_umount) sync_filesystem() do auto-defragment and produce lots of dirty pages close_ctree()

Re: [PATCH 1/4] vfs: introduce try_to_writeback_inodes_sb(_nr)

2012-04-25 Thread Dave Chinner
On Thu, Apr 26, 2012 at 10:57:43AM +0800, Miao Xie wrote: > writeback_inodes_sb(_nr) grabs s_umount lock when it want to start writeback, > it may bring us deadlock problem when doing umount. So we introduce new > functions -- try_to_writeback_inodes_sb(_nr) -- which use down_read_trylock() > inste

[RFC PATCH v2] Btrfs: improve space count for files with fragments

2012-04-25 Thread Liu Bo
Here is a simple scenario: $ dd if=/dev/zero of=/mnt/btrfs/foobar bs=1k count=20;sync $ btrfs fi df /mnt/btrfs we get 20K used, but then $ dd if=/dev/zero of=/mnt/btrfs/foobar bs=1k count=4 seek=4 conv=notrunc;sync $ btrfs fi df /mnt/btrfs we get 24K used. Here is the problem, it is possible that