[PATCH 0/6] random bugfixes of the space management

2010-12-22 Thread Miao Xie
Hello, I have a bunch of random fixes of the space management in git://repo.or.cz/linux-btrfs-devel.git space-manage They are the ENOSPC fixes, as well as fixes for df command. The first one and the last one fixed the wrong free space information reported by df command. The second one fixed

[PATCH 1/6] btrfs: fix wrong data space statistics

2010-12-22 Thread Miao Xie
Josef has implemented mixed data/metadata chunks, we must add those chunks' space just like data chunks. Signed-off-by: Miao Xie mi...@cn.fujitsu.com --- fs/btrfs/super.c |7 +++ 1 files changed, 3 insertions(+), 4 deletions(-) diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c index

[PATCH 2/6] btrfs: try to reclaim some space when chunk allocation fails

2010-12-22 Thread Miao Xie
We cannot write data into files when when there is tiny space in the filesystem. Reproduce steps: # mkfs.btrfs /dev/sda1 # mount /dev/sda1 /mnt # dd if=/dev/zero of=/mnt/tmpfile0 bs=4K count=1 # dd if=/dev/zero of=/mnt/tmpfile1 bs=4K count=99 (fill the filesystem) # umount

[PATCH 4/6] btrfs: restructure find_free_dev_extent()

2010-12-22 Thread Miao Xie
- make it return the start position and length of the max free space when it can not find a suitable free space. - make it more readability Signed-off-by: Miao Xie mi...@cn.fujitsu.com --- fs/btrfs/extent-tree.c |4 +- fs/btrfs/volumes.c | 155

[PATCH 3/6] btrfs: fix wrong calculation of stripe size

2010-12-22 Thread Miao Xie
There are two tiny problem: - One is When we check the chunk size is greater than the max chunk size or not, we should take mirrors into account, but the original code didn't. - The other is btrfs shouldn't use the size of the residual free space as the length of of a dup chunk when doing

[PATCH 6/6] btrfs: fix wrong free space information of btrfs

2010-12-22 Thread Miao Xie
When we store data by raid profile in btrfs with two or more different size disks, df command shows there is some free space in the filesystem, but the user can not write any data in fact, df command shows the wrong free space information of btrfs. # mkfs.btrfs -d raid1 /dev/sda9 /dev/sda10 #

Re: [PATCH 4/6] btrfs: restructure find_free_dev_extent()

2010-12-22 Thread Arne Jansen
Hi, this patch seems to have the same intention as the patch I sent to the list on Dec 11 Fixing the chunk allocator to allow it to better utilize the devices. The result is quite similar, except that you left the line search_start = max(root-fs_info-alloc_start, search_start); in place, which

Re: [PATCH 2/6] btrfs: try to reclaim some space when chunk allocation fails

2010-12-22 Thread Josef Bacik
On Wed, Dec 22, 2010 at 06:47:20PM +0800, Miao Xie wrote: We cannot write data into files when when there is tiny space in the filesystem. Reproduce steps: # mkfs.btrfs /dev/sda1 # mount /dev/sda1 /mnt # dd if=/dev/zero of=/mnt/tmpfile0 bs=4K count=1 # dd if=/dev/zero

Re: [PATCH 0/6] random bugfixes of the space management

2010-12-22 Thread Chris Mason
Excerpts from Josef Bacik's message of 2010-12-22 14:22:54 -0500: On Wed, Dec 22, 2010 at 06:47:08PM +0800, Miao Xie wrote: Hello, I have a bunch of random fixes of the space management in git://repo.or.cz/linux-btrfs-devel.git space-manage They are the ENOSPC fixes, as well as

Re: btrfs: 21 minutes to read 1.2M file directory

2010-12-22 Thread Andy Isaacson
On Tue, Dec 21, 2010 at 03:07:33AM +0200, Felipe Contreras wrote: On Tue, Dec 21, 2010 at 12:24 AM, Andy Isaacson a...@hexapodia.org wrote: I have a directory with 1.2M files in it, which makes readdir very slow on btrfs with cold caches (although it's reasonably fast with hot caches as in

Re: btrfs: 21 minutes to read 1.2M file directory

2010-12-22 Thread Hugo Mills
On Wed, Dec 22, 2010 at 12:39:15PM -0800, Andy Isaacson wrote: On Tue, Dec 21, 2010 at 03:07:33AM +0200, Felipe Contreras wrote: On Tue, Dec 21, 2010 at 12:24 AM, Andy Isaacson a...@hexapodia.org wrote: I have a directory with 1.2M files in it, which makes readdir very slow on btrfs with

Re: [PATCH 4/6] btrfs: restructure find_free_dev_extent()

2010-12-22 Thread Miao Xie
On wed, 22 Dec 2010 13:07:18 +0100, Arne Jansen wrote: this patch seems to have the same intention as the patch I sent to the list on Dec 11 Fixing the chunk allocator to allow it to better utilize the devices. The result is quite similar, except that you left the line Ahhh, partial code is