Re: [PATCH] Btrfs: separate out tests into their own directory

2013-08-15 Thread Josef Bacik
On Thu, Aug 15, 2013 at 01:23:53AM +0100, Filipe David Manana wrote: On Wed, Aug 14, 2013 at 8:28 PM, Josef Bacik jba...@fusionio.com wrote: The plan is to have a bunch of unit tests that run when btrfs is loaded when you build with the appropriate config option. My ultimate goal is to

Re: [PATCH] Btrfs: separate out tests into their own directory

2013-08-15 Thread Josef Bacik
On Thu, Aug 15, 2013 at 09:38:33AM -0400, Josef Bacik wrote: On Thu, Aug 15, 2013 at 01:23:53AM +0100, Filipe David Manana wrote: On Wed, Aug 14, 2013 at 8:28 PM, Josef Bacik jba...@fusionio.com wrote: The plan is to have a bunch of unit tests that run when btrfs is loaded when you

[PATCH v8 5/8] Btrfs: fill UUID tree initially

2013-08-15 Thread Stefan Behrens
When the UUID tree is initially created, a task is spawned that walks through the root tree. For each found subvolume root_item, the uuid and received_uuid entries in the UUID tree are added. This is such a quick operation so that in case somebody wants to unmount the filesystem while the task is

[PATCH v8 0/8] Btrfs: introduce a tree for UUID to subvol ID mapping

2013-08-15 Thread Stefan Behrens
Mapping UUIDs to subvolume IDs is an operation with a high effort today. Today, the algorithm even has quadratic effort (based on the number of existing subvolumes), which means, that it takes minutes to send/receive a single subvolume if 10,000 subvolumes exist. But even linear effort would be

[PATCH v8 3/8] Btrfs: create UUID tree if required

2013-08-15 Thread Stefan Behrens
This tree is not created by mkfs.btrfs. Therefore when a filesystem is mounted writable and the UUID tree does not exist, this tree is created if required. The tree is also added to the fs_info structure and initialized, but this commit does not yet read or write UUID tree elements.

[PATCH v8 4/8] Btrfs: maintain subvolume items in the UUID tree

2013-08-15 Thread Stefan Behrens
When a new subvolume or snapshot is created, a new UUID item is added to the UUID tree. Such items are removed when the subvolume is deleted. The ioctl to set the received subvolume UUID is also touched and will now also add this received UUID into the UUID tree together with the ID of the

[PATCH v8 7/8] Btrfs: check UUID tree during mount if required

2013-08-15 Thread Stefan Behrens
If the filesystem was mounted with an old kernel that was not aware of the UUID tree, this is detected by looking at the uuid_tree_generation field of the superblock (similar to how the free space cache is doing it). If a mismatch is detected at mount time, a thread is started that does two

[PATCH v8 1/8] Btrfs: introduce a tree for items that map UUIDs to something

2013-08-15 Thread Stefan Behrens
Mapping UUIDs to subvolume IDs is an operation with a high effort today. Today, the algorithm even has quadratic effort (based on the number of existing subvolumes), which means, that it takes minutes to send/receive a single subvolume if 10,000 subvolumes exist. But even linear effort would be

[PATCH v8 6/8] Btrfs: introduce uuid-tree-gen field

2013-08-15 Thread Stefan Behrens
In order to be able to detect the case that a filesystem is mounted with an old kernel, add a uuid-tree-gen field like the free space cache is doing it. It is part of the super block and written with each commit. Old kernels do not know this field and don't update it. Signed-off-by: Stefan

[PATCH v8 8/8] Btrfs: add mount option to force UUID tree checking

2013-08-15 Thread Stefan Behrens
This should never be needed, but since all functions are there to check and rebuild the UUID tree, a mount option is added that allows to force this check and rebuild procedure. Signed-off-by: Stefan Behrens sbehr...@giantdisaster.de --- fs/btrfs/ctree.h | 1 + fs/btrfs/disk-io.c | 3 ++-

[PATCH v8 2/8] Btrfs: support printing UUID tree elements

2013-08-15 Thread Stefan Behrens
This commit adds support to print UUID tree elements to print-tree.c. Signed-off-by: Stefan Behrens sbehr...@giantdisaster.de --- fs/btrfs/print-tree.c | 24 1 file changed, 24 insertions(+) diff --git a/fs/btrfs/print-tree.c b/fs/btrfs/print-tree.c index

Re: Kernel BUG on Snapshot Deletion (3.11.0-rc5)

2013-08-15 Thread Mitch Harder
I'm running into a curious problem. In the process of making my script portable, I am breaking the ability to replicate the error. I'm trying to isolate the aspect of my local script that is triggering the error. No firm insights yet. On Tue, Aug 13, 2013 at 11:03 AM, Mitch Harder

[PATCH] Btrfs: separate out tests into their own directory V2

2013-08-15 Thread Josef Bacik
The plan is to have a bunch of unit tests that run when btrfs is loaded when you build with the appropriate config option. My ultimate goal is to have a test for every non-static function we have, but at first I'm going to focus on the things that cause us the most problems. To start out with

[PATCH] btrfs-progs: restore passing of super_bytenr to device scan

2013-08-15 Thread Jeff Mahoney
Commit 615f2867 (Btrfs-progs: cleanup similar code in open_ctree_* and close_ctree) introduced a regression in btrfs-convert. open_ctree takes a sb_bytenr argument to specify where to find the superblock. Under normal conditions, this will be at BTRFS_SUPER_INFO_OFFSET, and that commit assumed as

Re: [PATCH] btrfs-progs: restore passing of super_bytenr to device scan

2013-08-15 Thread Wang Shilong
add to the list Helo, I have sent a patch for this before: https://patchwork.kernel.org/patch/2828820/ Thanks, Wang Commit 615f2867 (Btrfs-progs: cleanup similar code in open_ctree_* and close_ctree) introduced a regression in btrfs-convert. open_ctree takes a sb_bytenr argument