Re: Mis-Design of Btrfs?

2011-07-13 Thread Arne Jansen
On 14.07.2011 08:02, Ric Wheeler wrote: On 07/14/2011 06:56 AM, NeilBrown wrote: I'm certainly open to suggestions and collaboration. Do you have in mind any particular way to make the interface richer?? If a file system uses checksumming or other data corruption detection bits, it can detect

Re: Mis-Design of Btrfs?

2011-07-13 Thread Ric Wheeler
On 07/14/2011 07:38 AM, NeilBrown wrote: On Thu, 14 Jul 2011 07:02:22 +0100 Ric Wheeler wrote: I'm certainly open to suggestions and collaboration. Do you have in mind any particular way to make the interface richer?? NeilBrown Hi Neil, I know that Chris has a very specific set of use case

Re: Mis-Design of Btrfs?

2011-07-13 Thread NeilBrown
On Thu, 14 Jul 2011 07:02:22 +0100 Ric Wheeler wrote: > > I'm certainly open to suggestions and collaboration. Do you have in mind > > any > > particular way to make the interface richer?? > > > > NeilBrown > > Hi Neil, > > I know that Chris has a very specific set of use cases for btrfs and

Re: Mis-Design of Btrfs?

2011-07-13 Thread Ric Wheeler
On 07/14/2011 06:56 AM, NeilBrown wrote: On Wed, 29 Jun 2011 10:29:53 +0100 Ric Wheeler wrote: On 06/27/2011 07:46 AM, NeilBrown wrote: On Thu, 23 Jun 2011 12:53:37 +0200 Nico Schottelius wrote: Good morning devs, I'm wondering whether the raid- and volume-management-builtin of btrfs is

Re: Mis-Design of Btrfs?

2011-07-13 Thread NeilBrown
On Wed, 29 Jun 2011 10:29:53 +0100 Ric Wheeler wrote: > On 06/27/2011 07:46 AM, NeilBrown wrote: > > On Thu, 23 Jun 2011 12:53:37 +0200 Nico Schottelius > > wrote: > > > >> Good morning devs, > >> > >> I'm wondering whether the raid- and volume-management-builtin of btrfs is > >> actually a san

Re: [PATCH 00/16] Btrfs: fixes and cleanups for 3.1

2011-07-13 Thread Li Zefan
Li Zefan wrote: > The first 4 patches are bug-fixes, and the remaining are small > cleanups that have sit in my git tree for some time. > > The first 3 patches have been sent to the list before. > To pull the patchset: git://repo.or.cz/linux-btrfs-devel.git for-chris It's based on the

[PATCH 16/16] Btrfs: clean up for find_first_extent_bit()

2011-07-13 Thread Li Zefan
From: Xiao Guangrong find_first_extent_bit() and find_first_extent_bit_state() share most of the code, and we can just make the former call the latter. Signed-off-by: Xiao Guangrong Signed-off-by: Li Zefan --- fs/btrfs/extent_io.c | 64 ++--- 1 fi

[PATCH 15/16] Btrfs: clean up for wait_extent_bit()

2011-07-13 Thread Li Zefan
From: Xiao Guangrong We can just use cond_resched_lock(). Signed-off-by: Xiao Guangrong Signed-off-by: Li Zefan --- fs/btrfs/extent_io.c |6 +- 1 files changed, 1 insertions(+), 5 deletions(-) diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index 6c7394f..1959a63 100644 ---

[PATCH 14/16] Btrfs: clean up for insert_state()

2011-07-13 Thread Li Zefan
From: Xiao Guangrong Don't duplicate set_state_bits(). Signed-off-by: Xiao Guangrong Signed-off-by: Li Zefan --- fs/btrfs/extent_io.c | 10 +- 1 files changed, 5 insertions(+), 5 deletions(-) diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index b181a94..6c7394f 100644 ---

[PATCH 13/16] Btrfs: remove unused members from struct extent_state

2011-07-13 Thread Li Zefan
From: Xiao Guangrong These members are not used at all. Signed-off-by: Xiao Guangrong Signed-off-by: Li Zefan --- fs/btrfs/extent_io.h |2 -- 1 files changed, 0 insertions(+), 2 deletions(-) diff --git a/fs/btrfs/extent_io.h b/fs/btrfs/extent_io.h index a11a92e..d04ca37 100644 --- a/fs/b

[PATCH 12/16] Btrfs: clean up code for merging extent maps

2011-07-13 Thread Li Zefan
unpin_extent_cache() and add_extent_mapping() shares the same code that merges extent maps. Signed-off-by: Li Zefan --- fs/btrfs/extent_map.c | 59 +--- 1 files changed, 21 insertions(+), 38 deletions(-) diff --git a/fs/btrfs/extent_map.c b/fs/btrfs

[PATCH 11/16] Btrfs: clean up code for extent_map lookup

2011-07-13 Thread Li Zefan
lookup_extent_map() and search_extent_map() can share most of code. Signed-off-by: Li Zefan --- fs/btrfs/extent_map.c | 85 + 1 files changed, 29 insertions(+), 56 deletions(-) diff --git a/fs/btrfs/extent_map.c b/fs/btrfs/extent_map.c index 911

[PATCH 10/16] Btrfs: clean up search_extent_mapping()

2011-07-13 Thread Li Zefan
rb_node returned by __tree_search() can be a valid pointer or NULL, but won't be some errno. Signed-off-by: Li Zefan --- fs/btrfs/extent_map.c | 17 +++-- 1 files changed, 3 insertions(+), 14 deletions(-) diff --git a/fs/btrfs/extent_map.c b/fs/btrfs/extent_map.c index 2d04103..91

[PATCH 09/16] Btrfs: remove redundant code for dir item lookup

2011-07-13 Thread Li Zefan
When we search a dir item with a specific hash code, we can just return NULL without further checking if btrfs_search_slot() returns 1. Signed-off-by: Li Zefan --- fs/btrfs/dir-item.c | 30 ++ 1 files changed, 2 insertions(+), 28 deletions(-) diff --git a/fs/btrfs/

[PATCH 08/16] Btrfs: make acl functions really no-op if acl is not enabled

2011-07-13 Thread Li Zefan
So there's no overhead for something we don't use. Signed-off-by: Li Zefan --- fs/btrfs/Makefile |4 +++- fs/btrfs/acl.c| 17 - fs/btrfs/ctree.h | 15 --- 3 files changed, 15 insertions(+), 21 deletions(-) diff --git a/fs/btrfs/Makefile b/fs/btrfs/Makefi

[PATCH 07/16] Btrfs: remove remaining ref-cache code

2011-07-13 Thread Li Zefan
Since commit f2a97a9dbd86eb1ef956bdf20e05c507b32beb96 ("btrfs: remove all unused functions"), there's no extern functions at all in ref-cache.c, so just remove the remaining dead code. Signed-off-by: Li Zefan --- fs/btrfs/ref-cache.c | 68 -- fs/

[PATCH 06/16] Btrfs: remove a BUG_ON() in btrfs_commit_transaction()

2011-07-13 Thread Li Zefan
wait_for_commit() always returns 0. Signed-off-by: Li Zefan --- fs/btrfs/transaction.c |6 ++ 1 files changed, 2 insertions(+), 4 deletions(-) diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c index 34a30ea..40726ac 100644 --- a/fs/btrfs/transaction.c +++ b/fs/btrfs/transacti

[PATCH 05/16] Btrfs: use wait_event()

2011-07-13 Thread Li Zefan
Use wait_event() when possible to avoid code duplication. Signed-off-by: Li Zefan --- fs/btrfs/transaction.c | 59 +-- 1 files changed, 7 insertions(+), 52 deletions(-) diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c index 51dcec8..34a3

[PATCH 04/16] Btrfs: check the nodatasum flag when writing compressed files

2011-07-13 Thread Li Zefan
If mounting with nodatasum option, we won't csum file data for general write or direct-io write, and this rule should also be applied when writing compressed files. Signed-off-by: Li Zefan --- fs/btrfs/compression.c | 14 ++ 1 files changed, 10 insertions(+), 4 deletions(-) diff -

[PATCH 03/16] Btrfs: fix space leak when trimming free extents

2011-07-13 Thread Li Zefan
When the end of an extent exceeds the end of the specified range, the extent will be accidentally truncated. Signed-off-by: Li Zefan --- fs/btrfs/free-space-cache.c |9 - 1 files changed, 8 insertions(+), 1 deletions(-) diff --git a/fs/btrfs/free-space-cache.c b/fs/btrfs/free-space-

[PATCH 02/16] Btrfs: fix space leak when skipping small extents during trimming

2011-07-13 Thread Li Zefan
We're taking a free space extent out of the free space cache, trimming it and then putting it back into the cache. However for an extent that is smaller than the specified minimum length, it's taken out but won't be put back, which causes space leak. Signed-off-by: Li Zefan --- fs/btrfs/free-sp

[PATCH 01/16] Btrfs: copy string correctly in INO_LOOKUP ioctl

2011-07-13 Thread Li Zefan
Memory areas [ptr, ptr+total_len] and [name, name+total_len] may overlap, so it's wrong to use memcpy(). Signed-off-by: Li Zefan --- fs/btrfs/ioctl.c |3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index a3c4751..08a4580 100644 --- a

[PATCH 00/16] Btrfs: fixes and cleanups for 3.1

2011-07-13 Thread Li Zefan
The first 4 patches are bug-fixes, and the remaining are small cleanups that have sit in my git tree for some time. The first 3 patches have been sent to the list before. We save some bytes after this patchset: textdata bss dec hex filename 42638738541024 431265 69

[PATCH] Btrfs: don't print the leaf if we had an error

2011-07-13 Thread Josef Bacik
In __btrfs_free_extent we will print the leaf if we fail to find the extent we wanted, but the problem is if we get an error we won't have a leaf so often this leads to a NULL pointer dereference and we lose the error that actually occurred. So only print the leaf if ret > 0, which means we didn't

Re: Delayed inode operations not doing the right thing with enospc

2011-07-13 Thread Josef Bacik
On 07/12/2011 11:20 AM, Christian Brunner wrote: > 2011/6/7 Josef Bacik : >> On 06/06/2011 09:39 PM, Miao Xie wrote: >>> On fri, 03 Jun 2011 14:46:10 -0400, Josef Bacik wrote: I got a lot of these when running stress.sh on my test box This is because use_block_rsv() is havi

Re: btrfs hang in flush-btrfs-5

2011-07-13 Thread Josef Bacik
On 07/11/2011 05:21 PM, Jeremy Sanders wrote: > Josef Bacik wrote: > >> On 07/11/2011 07:40 AM, Jeremy Sanders wrote: >>> Jeremy Sanders wrote: >>> Hi - I'm trying btrfs with kernel 2.6.38.8-32.fc15.x86_64 (a Fedora kernel). I'm just doing a tar-to-tar copy onto the file system with