Re: [PATCH V3] btrfs: implement delayed inode items operation

2011-03-18 Thread Itaru Kitayama
Hi Miao, Your updated V4 patch no longer gives me a hang. Thank you. In the latest V4, btrfs_remove_delayed_node() does just release a delayed node and returns for most of the time, but for space cache inodes, it takes trans_mutex and writes the delayed nodes out to the tree. Is my

Re: [PATCH V3] btrfs: implement delayed inode items operation

2011-03-18 Thread Miao Xie
On fri, 18 Mar 2011 17:59:04 +0900, Itaru Kitayama wrote: Hi Miao, Your updated V4 patch no longer gives me a hang. Thank you. In the latest V4, btrfs_remove_delayed_node() does just release a delayed node and returns for most of the time, but for space Right. cache inodes, it takes

how to backup

2011-03-18 Thread Lubos Kolouch
Hello, Say I have a btrfs-formatted disk with many subvolumes/snapshots. How do I do backup (over network) ? If I use just rsync, I will get many copies of the files (one for each snapshot). So I would need to write a tool that would - get listing of the subvolumes/snapshots - somehow figure

Re: [PATCH] Btrfs: check items for correctness as we search V3

2011-03-18 Thread Andrey Kuzmin
On Fri, Mar 18, 2011 at 3:52 AM, Chris Mason chris.ma...@oracle.com wrote: Excerpts from Andrey Kuzmin's message of 2011-03-17 15:12:32 -0400: On Thu, Mar 17, 2011 at 9:18 PM, Josef Bacik jo...@redhat.com wrote: Currently if we have corrupted items things will blow up in spectacular ways.

Re: [PATCH] btrfs: quasi-round-robin for chunk allocation

2011-03-18 Thread Chris Mason
Excerpts from Arne Jansen's message of 2011-03-17 11:58:46 -0400: On 09.02.2011 04:03, Miao Xie wrote: On tue, 8 Feb 2011 19:03:32 +0100, Arne Jansen wrote: In a multi device setup, the chunk allocator currently always allocates chunks on the devices in the same order. This leads to a

[PATCH v4 4/6] btrfs: sync scrub with commit device removal

2011-03-18 Thread Arne Jansen
This adds several synchronizations: - for a transaction commit, the scrub gets paused before the tree roots are committed until the super are safely on disk - during a log commit, scrubbing of supers is disabled - on unmount, the scrub gets cancelled - on device removal, the scrub for the

[PATCH v4 1/6] btrfs: add parameter to btrfs_lookup_csum_range

2011-03-18 Thread Arne Jansen
A parameter is added to search the commit root instead of the live root. Signed-off-by: Arne Jansen sensi...@gmx.net --- fs/btrfs/ctree.h |4 ++-- fs/btrfs/file-item.c |8 +++- fs/btrfs/inode.c |2 +- fs/btrfs/relocation.c |2 +- fs/btrfs/tree-log.c |4 ++--

[PATCH v4 6/6] btrfs: new ioctls for scrub

2011-03-18 Thread Arne Jansen
From: Jan Schmidt list.bt...@jan-o-sch.net adds ioctls necessary to start and cancel scrubs, to get current progress and to get info about devices to be scrubbed. Note that the scrub is done per-device and that the ioctl only returns after the scrub for this devices is finished or has been

[PATCH v4 3/6] btrfs: add scrub code and prototypes

2011-03-18 Thread Arne Jansen
This is the main scrub code. Updates v3: - fixed EIO handling, need to reallocate bio instead of reusing it - Updated according to David Sterba's review - don't clobber bi_flags on reuse, just set UPTODATE - allocate long living bios with bio_kmalloc instead of bio_alloc Updates v4: -

[PATCH v4 0/6] btrfs: scrub

2011-03-18 Thread Arne Jansen
This series adds an initial implementation for scrub. It works quite straightforward. The usermode issues an ioctl for each device in the fs. For each device, it enumerates the allocated device chunks. For each chunk, the contained extents are enumerated and the data checksums fetched. The extents

[PATCH v4 2/6] btrfs: make struct map_lookup public

2011-03-18 Thread Arne Jansen
definition of struct map_lookup moved from volumes.c to the header Signed-off-by: Arne Jansen sensi...@gmx.net --- fs/btrfs/volumes.c | 14 -- fs/btrfs/volumes.h | 14 ++ 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/fs/btrfs/volumes.c

[PATCH v4 5/6] btrfs: add state information for scrub

2011-03-18 Thread Arne Jansen
Add structures and state information needed for scrub Signed-off-by: Arne Jansen sensi...@gmx.net --- fs/btrfs/ctree.h | 25 + fs/btrfs/disk-io.c | 15 +++ fs/btrfs/ioctl.h | 17 + fs/btrfs/volumes.h |3 +++ 4 files changed, 60

[PATCH] btrfs scrub: make fixups sync, don't reuse fixup bios

2011-03-18 Thread Ilya Dryomov
[CC'ing the list to make development public, the patch is againt Arne's tree at kernel.org] Hello Arne, Below is a quite long diff the primary purpose of which is to make fixups totally sync. They are already sync for checksum failures, this patch makes them sync for EIO case as well. This is

Re: [PATCH] btrfs: quasi-round-robin for chunk allocation

2011-03-18 Thread cwillu
On Fri, Mar 18, 2011 at 8:40 AM, Chris Mason chris.ma...@oracle.com wrote: I think that filling all the devices fully is more important than the initial spread.  Miao is correct that the administrator will probably complain if all the devices aren't used for the initial stripes. But, over the

[PATCH] Btrfs: check free space in block group before searching for a cluster

2011-03-18 Thread Josef Bacik
The free space cluster stuff is heavy duty, so there is no sense in going through the entire song and dance if there isn't enough space in the block group to begin with. Thanks, Signed-off-by: Josef Bacik jo...@redhat.com --- fs/btrfs/free-space-cache.c | 10 ++ 1 files changed, 10

[PATCH] Btrfs: deal with min_bytes appropriately when looking for a cluster

2011-03-18 Thread Josef Bacik
We do all this fun stuff with min_bytes, but either don't use it in the case of just normal extents, or use it completely wrong in the case of bitmaps. So fix this for both cases 1) In the extent case, stop looking for space with window_free = min_bytes instead of bytes + empty_size. 2) In the

Re: [PATCH] btrfs: quasi-round-robin for chunk allocation

2011-03-18 Thread Arne Jansen
On 18.03.2011 17:25, cwillu wrote: On Fri, Mar 18, 2011 at 8:40 AM, Chris Masonchris.ma...@oracle.com wrote: I think that filling all the devices fully is more important than the initial spread. Miao is correct that the administrator will probably complain if all the devices aren't used for

[PATCH] Btrfs: don't be as aggressive about using bitmaps

2011-03-18 Thread Josef Bacik
We have been creating bitmaps for small extents unconditionally forever. This was great when testing to make sure the bitmap stuff was working, but is overkill normally. So instead of always adding small chunks of free space to bitmaps, only start doing it if we go past half of our extent

Re: [PATCH] btrfs: properly access unaligned checksum buffer

2011-03-18 Thread David Sterba
On Fri, Mar 18, 2011 at 11:56:53AM -0400, Chris Mason wrote: Thanks for fielding this one. Does put_unaligned_le32 optimize away on platforms with efficient access? It would be great if we didn't need the #ifdef. (quicktest: assembly output is same for put_unaligned_le32 and direct

Re: kernel BUG at fs/btrfs/extent-tree.c:2195! and WARNING: at fs/btrfs/extent-tree.c:5695 btrfs_alloc_free_block+0xc2/0x287 [btrfs]()

2011-03-18 Thread Sergei Trofimovich
Hi list! I've built vanilla 2.6.38 and decided to try btrfs today. I've created 2GB image file on ext4 filesystem and setup a loop device /dev/loop0: $ dd if=/dev/zero of=btrfs.image bs=$((1024 * 1024)) count=2048 $ losetup /dev/loop0 btrfs.image $ mkfs.btrfs -LBTRFS_TESTIE /dev/loop0 $