Re: [PATCH] Btrfs-progs: replace find_mount_root from send code

2012-08-28 Thread Alex Lyakas
Thank you, Robert for the detailed data. I will debug & get back to you before Friday. Alex. On Mon, Aug 27, 2012 at 9:37 PM, Robert Buhren wrote: > Hi Alex, > > i've made a list of all commands i executed for this test. You can find it > here: > > http://pastebin.com/y8PBgmMZ > > > >> Hi Rober

Re: raw partition or LV for btrfs? (FAQ updated)

2012-08-28 Thread Daniel Pocock
On 22/08/12 17:42, David Sterba wrote: > On Tue, Aug 14, 2012 at 07:23:48AM -0400, Calvin Walton wrote: >> A patch to add support for `btrfs fi defrag -c none ` or so would >> make this easier, and shouldn't be to hard to do :) > > This one is on my list of 'nice to have', it's needed to extend

Re: [PATCH] Btrfs-progs: replace find_mount_root from send code

2012-08-28 Thread Alex Lyakas
Hi Robert, can you pls apply this patch. It should solve the issue (your script now runs ok for me). Alex. diff --git a/cmds-receive.c b/cmds-receive.c index a8be6fa..3ee2ff8 100644 --- a/cmds-receive.c +++ b/cmds-receive.c @@ -792,11 +792,18 @@ int do_receive(struct btrfs_receive *r, const char

Re: [PATCH 2/2] Btrfs: improve fsync by filtering extents that we want

2012-08-28 Thread Josef Bacik
On Mon, Aug 27, 2012 at 06:22:02PM -0600, Liu Bo wrote: > On 08/28/2012 01:12 AM, Josef Bacik wrote: > > On Mon, Aug 27, 2012 at 10:52:20AM -0600, Liu Bo wrote: > >> This is based on Josef's "Btrfs: turbo charge fsync". > >> > >> The above Josef's patch performs very good in random sync write test,

“Bug”-report: inconsistency kernel <-> tools

2012-08-28 Thread M G Berberich
Hello, We had set up a btrfs-fs over 6 hot-plugable SAS-disks for testing and got it into a state where kernel and btrfs-tools do not agree any more about the state of the filesystem. We do not remember exaclty what we did, but roughly it was something like this (on the running system). THIS IS F

[PATCH V3 1/7 RESEND] Btrfs: fix error path in create_pending_snapshot()

2012-08-28 Thread Miao Xie
This patch fixes the following problem: - If we failed to deal with the delayed dir items, we should abort transaction, just as its comment said. Fix it. - If root reference or root back reference insertion failed, we should abort transaction. Fix it. - Fix the double free problem of pending->i

[PATCH 2/7 RESEND] Btrfs: fix full backref problem when inserting shared block reference

2012-08-28 Thread Miao Xie
If we create several snapshots at the same time, the following BUG_ON() will be triggered. kernel BUG at fs/btrfs/extent-tree.c:6047! Steps to reproduce: # mkfs.btrfs # mount # cd # for ((i=0;i<2400;i++)); do touch long_name_to_make_tree_more_deep$i; done # for ((i=0; i<4; i++))

[PATCH 3/7] Btrfs: fix file extent discount problem in the snapshot

2012-08-28 Thread Miao Xie
If a snapshot is created while we are writing some data into the file, the i_size of the corresponding file in the snapshot will be wrong, it will be beyond the end of the last file extent. And btrfsck will report: root 256 inode 257 errors 100 Steps to reproduce: # mkfs.btrfs # mount # cd

[PATCH 4/7] Btrfs: use a slab for ordered extents allocation

2012-08-28 Thread Miao Xie
The ordered extent allocation is in the fast path of the IO, so use a slab to improve the speed of the allocation. Signed-off-by: Miao Xie --- fs/btrfs/ordered-data.c | 23 +-- fs/btrfs/ordered-data.h |2 ++ fs/btrfs/super.c|9 - 3 files changed, 31

[PATCH 5/7] Btrfs: fix wrong orphan count of the fs/file tree

2012-08-28 Thread Miao Xie
If we add a new orphan item, we should increase the atomic counter, not decrease it. Fix it. Signed-off-by: Miao Xie --- fs/btrfs/inode.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 7131fac..cae4c32 100644 --- a/fs/btrfs/ino

[PATCH 6/7] Btrfs: fix corrupted metadata in the snapshot

2012-08-28 Thread Miao Xie
When we delete a inode, we will remove all the delayed items including delayed inode update, and then truncate all the relative metadata. If there is lots of metadata, we will end the current transaction, and start a new transaction to truncate the left metadata. In this way, we will leave a inode

[PATCH V3 7/7 RESEND] Btrfs: fix the snapshot that should not exist

2012-08-28 Thread Miao Xie
The snapshot should be the image of the fs tree before it was created, so the metadata of the snapshot should not exist in the its tree. But now, we found the directory item and directory name index is in both the snapshot tree and the fs tree. It introduces some problems and makes the users feel s

[PATCH] Btrfs-progs: fix wrong return value of check_owner_ref()

2012-08-28 Thread Miao Xie
If we find the block by seach corresponding fs tree, we should return 0, and tell the caller we pass the check. Or btrfsck will fail to read the fs/file tree and report many error message by mistake. Signed-off-by: Miao Xie --- Several days ago, I sent this patch as a reply. Now I send it as a in

[PATCH 2/2 RESEND] Btrfs: flush all the dirty pages if try_to_writeback_inodes_sb_nr() fails

2012-08-28 Thread Miao Xie
We may try to flush some dirty pages when there is no enough space to reserve. But it is possible that this operation fails, in order to get enough space to reserve successfully, we will sync all the delalloc file. This operation is safe, we needn't worry about the case that the filesystem goes fro

[PATCH 1/2 RESEND] vfs: re-implement writeback_inodes_sb(_nr)_if_idle() and rename them

2012-08-28 Thread Miao Xie
writeback_inodes_sb(_nr)_if_idle() is re-implemented by replacing down_read() with down_read_trylock() because - If ->s_umount is write locked, then the sb is not idle. That is writeback_inodes_sb(_nr)_if_idle() needn't wait for the lock. - writeback_inodes_sb(_nr)_if_idle() grabs s_umount lock w

Re: [BUG] btrfs dev del causes 'possible circular locking dependency detected'

2012-08-28 Thread Miao Xie
On Thu, 09 Aug 2012 18:44:12 +0200, Stefan Behrens wrote: > On Thu, 9 Aug 2012 18:01:57 +0200, David Sterba wrote: >> On Thu, Aug 09, 2012 at 05:36:54PM +0200, Stefan Behrens wrote: >>> Aug 9 16:02:21 qvarne kernel: [ 543.479460] -> #2 >>> (&fs_info->cleaner_mutex){+.+...}: >>> Aug 9 16:02:21 q