[PATCH] Btrfs: fix possible memory leak in replace_path()

2013-05-08 Thread Stefan Behrens
callers of read_tree_block commit. Signed-off-by: Stefan Behrens sbehr...@giantdisaster.de --- fs/btrfs/relocation.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c index aca3c30..e45d899 100644 --- a/fs/btrfs/relocation.c +++ b/fs

Re: [RFC 0/5] BTRFS hot relocation support

2013-05-09 Thread Stefan Behrens
On 05/09/2013 01:13, Zhi Yong Wu wrote: HI, all I saw that bcache will be merged into kernel upstream soon, so i want to know if btrfs hot relocation support is still meanful, if no, i will not continue to work on it. can anyone let me know this? thanks. Which one is better? Please do

Re: [RFC 0/5] BTRFS hot relocation support

2013-05-09 Thread Stefan Behrens
On 05/09/2013 08:42, Zhi Yong Wu wrote: btrfs maintainer's opinion is very important, i guess. My opinion is not important and I shall shut up? On Thu, May 9, 2013 at 2:30 PM, Stefan Behrens sbehr...@giantdisaster.de wrote: On 05/09/2013 01:13, Zhi Yong Wu wrote: HI, all I saw

Re: [PATCH] btrfs-progs: image: handle superblocks correctly on fs with big blocks

2013-05-10 Thread Stefan Behrens
On 05/10/2013 13:20, David Sterba wrote: On Tue, May 07, 2013 at 10:44:05AM +0200, Stefan Behrens wrote: On Mon, 6 May 2013 23:11:20 +0200, David Sterba wrote: Superblock is always 4k, but metadata blocks may be larger. We have to use the appropriate block size when doing checksums, otherwise

[PATCH 0/3] Btrfs: some cleanups around btrfs_read_fs_root_no_name()

2013-05-13 Thread Stefan Behrens
for NULL which cannot happen. And one static inline function in delayed-inode.c that called btrfs_read_fs_root_no_name() was not at all used anymore. Stefan Behrens (3): Btrfs: delete unused function Btrfs: cleanup, btrfs_read_fs_root_no_name() doesn't return NULL Btrfs: cleanup: don't check

[PATCH 2/3] Btrfs: cleanup, btrfs_read_fs_root_no_name() doesn't return NULL

2013-05-13 Thread Stefan Behrens
No need to check for NULL in send.c. Signed-off-by: Stefan Behrens sbehr...@giantdisaster.de --- fs/btrfs/send.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/fs/btrfs/send.c b/fs/btrfs/send.c index ff40f1c..f075c82 100644 --- a/fs/btrfs/send.c +++ b/fs/btrfs/send.c

[PATCH 1/3] Btrfs: delete unused function

2013-05-13 Thread Stefan Behrens
Signed-off-by: Stefan Behrens sbehr...@giantdisaster.de --- fs/btrfs/delayed-inode.c | 14 -- 1 file changed, 14 deletions(-) diff --git a/fs/btrfs/delayed-inode.c b/fs/btrfs/delayed-inode.c index f26f38c..5615eac 100644 --- a/fs/btrfs/delayed-inode.c +++ b/fs/btrfs/delayed-inode.c

[PATCH 3/3] Btrfs: cleanup: don't check the same thing twice

2013-05-13 Thread Stefan Behrens
btrfs_read_fs_root_no_name() already checks if btrfs_root_refs() is zero and returns ENOENT in this case. There is no need to do it again in six places. Signed-off-by: Stefan Behrens sbehr...@giantdisaster.de --- fs/btrfs/export.c | 5 - fs/btrfs/file.c | 4 fs/btrfs/inode.c | 10

[PATCH v2 2/3] Btrfs: cleanup, btrfs_read_fs_root_no_name() doesn't return NULL

2013-05-13 Thread Stefan Behrens
No need to check for NULL in send.c and disk-io.c. Signed-off-by: Stefan Behrens sbehr...@giantdisaster.de --- v1 - v2: One more place where the check for NULL can be deleted. fs/btrfs/disk-io.c | 2 -- fs/btrfs/send.c| 8 ++-- 2 files changed, 2 insertions(+), 8 deletions(-) diff

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

2013-05-14 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 | 82 +++ 1 file changed, 82 insertions(+) diff --git a/fs/btrfs/print-tree.c b/fs/btrfs/print

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

2013-05-14 Thread Stefan Behrens
are successfully completed. Signed-off-by: Stefan Behrens sbehr...@giantdisaster.de --- fs/btrfs/ctree.h | 4 ++ fs/btrfs/disk-io.c | 18 +- fs/btrfs/transaction.c | 3 +- fs/btrfs/uuid-tree.c | 156 + fs/btrfs/volumes.c | 83

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

2013-05-14 Thread Stefan Behrens
is still running, the unmount is delayed until the UUID tree building task is finished. Signed-off-by: Stefan Behrens sbehr...@giantdisaster.de --- fs/btrfs/ctree.h | 3 ++ fs/btrfs/disk-io.c | 5 ++ fs/btrfs/volumes.c | 150 - 3 files changed

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

2013-05-14 Thread Stefan Behrens
are addressed. The hugest change was to add a mechanism that handles the case that the filesystem is mounted with an older kernel. Now that case is detected when the filesystem is mounted with a newer kernel again, and the UUID tree is updated in the background. Stefan Behrens (8): Btrfs: introduce

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

2013-05-14 Thread Stefan Behrens
for no good reason is also not good. That's the justification why a completely new tree was introduced. Signed-off-by: Stefan Behrens sbehr...@giantdisaster.de --- fs/btrfs/Makefile| 3 +- fs/btrfs/ctree.h | 50 ++ fs/btrfs/uuid-tree.c | 481

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

2013-05-14 Thread Stefan Behrens
-by: Stefan Behrens sbehr...@giantdisaster.de --- fs/btrfs/ctree.h | 1 + fs/btrfs/disk-io.c | 40 +++- fs/btrfs/volumes.c | 27 +++ fs/btrfs/volumes.h | 1 + 4 files changed, 68 insertions(+), 1 deletion(-) diff --git a/fs/btrfs/ctree.h

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

2013-05-14 Thread Stefan Behrens
of the subvolume. The latter is also done when read-only snapshots are created which inherit all the send/receive information from the parent subvolume. User mode programs use the BTRFS_IOC_TREE_SEARCH ioctl to search and read in the UUID tree. Signed-off-by: Stefan Behrens sbehr...@giantdisaster.de --- fs

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

2013-05-14 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 v2 8/8] Btrfs: add mount option to force UUID tree checking

2013-05-14 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 ++- fs

[PATCH v2 4/4] Btrfs-progs: add uuid_tree_gen field to btrfs-show-super

2013-05-14 Thread Stefan Behrens
Signed-off-by: Stefan Behrens sbehr...@giantdisaster.de --- btrfs-show-super.c | 2 ++ ctree.h| 5 - 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/btrfs-show-super.c b/btrfs-show-super.c index f587f10..c815469 100644 --- a/btrfs-show-super.c +++ b/btrfs-show

[PATCH v2 1/4] Btrfs-progs: Support UUID tree and UUID items in btrfs-debug-tree

2013-05-14 Thread Stefan Behrens
Support printing these things. Signed-off-by: Stefan Behrens sbehr...@giantdisaster.de --- ctree.h | 29 ++ print-tree.c | 96 ++-- 2 files changed, 122 insertions(+), 3 deletions(-) diff --git a/ctree.h b/ctree.h

[PATCH v2 0/4] Btrfs-progs: speedup btrfs send/receive

2013-05-14 Thread Stefan Behrens
. Stefan Behrens (4): Btrfs-progs: Support UUID tree and UUID items in btrfs-debug-tree Btrfs-progs: add UUID tree lookup methods Btrfs-progs: use UUID tree for send/receive Btrfs-progs: add uuid_tree_gen field to btrfs-show-super Makefile | 5 +- btrfs-show-super.c | 2 + cmds

[PATCH v2 3/4] Btrfs-progs: use UUID tree for send/receive

2013-05-14 Thread Stefan Behrens
that allow to quickly search for a given UUID and to retrieve data that is assigned to this UUID, like which subvolume ID is related to this UUID. Signed-off-by: Stefan Behrens sbehr...@giantdisaster.de --- cmds-receive.c | 23 ++- cmds-send.c| 53 +-- send-utils.c | 477

[PATCH v2 2/4] Btrfs-progs: add UUID tree lookup methods

2013-05-14 Thread Stefan Behrens
This commit adds UUID tree lookup methods that make use of the search ioctl. The code is based on the kernel code. Signed-off-by: Stefan Behrens sbehr...@giantdisaster.de --- Makefile| 5 +- ctree.h | 5 ++ uuid-tree.c | 175

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

2013-05-14 Thread Stefan Behrens
On Tue, 14 May 2013 18:55:23 +0800, Liu Bo wrote: On Tue, May 14, 2013 at 11:36:52AM +0200, Stefan Behrens wrote: 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

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

2013-05-15 Thread Stefan Behrens
On Tue, 14 May 2013 19:11:54 +0200, Stefan Behrens wrote: On Tue, 14 May 2013 18:55:23 +0800, Liu Bo wrote: On Tue, May 14, 2013 at 11:36:52AM +0200, Stefan Behrens wrote: Mapping UUIDs to subvolume IDs is an operation with a high effort today. Today, the algorithm even has quadratic effort

[PATCH] Btrfs-progs: detect when scrub is started twice

2013-05-15 Thread Stefan Behrens
-by: Stefan Behrens sbehr...@giantdisaster.de --- cmds-scrub.c | 42 ++ 1 file changed, 42 insertions(+) diff --git a/cmds-scrub.c b/cmds-scrub.c index c0dc584..95dfee3 100644 --- a/cmds-scrub.c +++ b/cmds-scrub.c @@ -1025,6 +1025,27 @@ int mkdir_p(char *path

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

2013-05-15 Thread Stefan Behrens
On Tue, 14 May 2013 18:44:11 +0800, Liu Bo wrote: On Tue, May 14, 2013 at 11:36:56AM +0200, Stefan Behrens wrote: @@ -396,7 +403,7 @@ static noinline int create_subvol(struct inode *dir, * of create_snapshot(). */ ret = btrfs_subvolume_reserve_metadata(root, block_rsv

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

2013-05-16 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 | 81 +++ 1 file changed, 81 insertions(+) diff --git a/fs/btrfs/print-tree.c b/fs/btrfs/print

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

2013-05-16 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 v3 4/8] Btrfs: maintain subvolume items in the UUID tree

2013-05-16 Thread Stefan Behrens
of the subvolume. The latter is also done when read-only snapshots are created which inherit all the send/receive information from the parent subvolume. User mode programs use the BTRFS_IOC_TREE_SEARCH ioctl to search and read in the UUID tree. Signed-off-by: Stefan Behrens sbehr...@giantdisaster.de --- fs

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

2013-05-16 Thread Stefan Behrens
for no good reason is also not good. That's the justification why a completely new tree was introduced. Signed-off-by: Stefan Behrens sbehr...@giantdisaster.de --- fs/btrfs/Makefile| 3 +- fs/btrfs/ctree.h | 50 ++ fs/btrfs/uuid-tree.c | 480

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

2013-05-16 Thread Stefan Behrens
is still running, the unmount is delayed until the UUID tree building task is finished. Signed-off-by: Stefan Behrens sbehr...@giantdisaster.de --- fs/btrfs/ctree.h | 3 ++ fs/btrfs/disk-io.c | 5 ++ fs/btrfs/volumes.c | 150 - 3 files changed

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

2013-05-16 Thread Stefan Behrens
the issue that the uuid-tree was not using the transaction block reserve. Stefan Behrens (8): Btrfs: introduce a tree for items that map UUIDs to something Btrfs: support printing UUID tree elements Btrfs: create UUID tree if required Btrfs: maintain subvolume items in the UUID tree

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

2013-05-16 Thread Stefan Behrens
are successfully completed. Signed-off-by: Stefan Behrens sbehr...@giantdisaster.de --- fs/btrfs/ctree.h | 4 ++ fs/btrfs/disk-io.c | 18 +- fs/btrfs/transaction.c | 3 +- fs/btrfs/uuid-tree.c | 156 + fs/btrfs/volumes.c | 83

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

2013-05-16 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 ++- fs

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

2013-05-16 Thread Stefan Behrens
-by: Stefan Behrens sbehr...@giantdisaster.de --- fs/btrfs/ctree.h | 1 + fs/btrfs/disk-io.c | 40 +++- fs/btrfs/extent-tree.c | 3 +++ fs/btrfs/volumes.c | 26 ++ fs/btrfs/volumes.h | 1 + 5 files changed, 70 insertions

[PATCH v3 0/4] Btrfs-progs: speedup btrfs send/receive

2013-05-16 Thread Stefan Behrens
. v2 - v3: - shrinked the uuid_item (this was a review comment from Liu Bo). Stefan Behrens (4): Btrfs-progs: Support UUID tree and UUID items in btrfs-debug-tree Btrfs-progs: add UUID tree lookup methods Btrfs-progs: use UUID tree for send/receive Btrfs-progs: add uuid_tree_gen field

[PATCH v3 4/4] Btrfs-progs: add uuid_tree_gen field to btrfs-show-super

2013-05-16 Thread Stefan Behrens
Signed-off-by: Stefan Behrens sbehr...@giantdisaster.de --- btrfs-show-super.c | 2 ++ ctree.h| 5 - 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/btrfs-show-super.c b/btrfs-show-super.c index f587f10..c815469 100644 --- a/btrfs-show-super.c +++ b/btrfs-show

[PATCH v3 2/4] Btrfs-progs: add UUID tree lookup methods

2013-05-16 Thread Stefan Behrens
This commit adds UUID tree lookup methods that make use of the search ioctl. The code is based on the kernel code. Signed-off-by: Stefan Behrens sbehr...@giantdisaster.de --- Makefile| 5 +- ctree.h | 5 ++ uuid-tree.c | 174

[PATCH v3 1/4] Btrfs-progs: Support UUID tree and UUID items in btrfs-debug-tree

2013-05-16 Thread Stefan Behrens
Support printing these things. Signed-off-by: Stefan Behrens sbehr...@giantdisaster.de --- ctree.h | 29 +++ print-tree.c | 95 ++-- 2 files changed, 121 insertions(+), 3 deletions(-) diff --git a/ctree.h b/ctree.h

[PATCH v3 3/4] Btrfs-progs: use UUID tree for send/receive

2013-05-16 Thread Stefan Behrens
that allow to quickly search for a given UUID and to retrieve data that is assigned to this UUID, like which subvolume ID is related to this UUID. Signed-off-by: Stefan Behrens sbehr...@giantdisaster.de --- cmds-receive.c | 23 ++- cmds-send.c| 53 +-- send-utils.c | 477

[PATCH] Btrfs: explicitly use global_block_rsv for quota_tree

2013-05-16 Thread Stefan Behrens
is used in btrfs_cow_block() falls back to the global_block_rsv in this case. But just in order to make it more clear what is happening, change it to explicitly use the global_block_rsv. Signed-off-by: Stefan Behrens sbehr...@giantdisaster.de --- fs/btrfs/extent-tree.c | 2 ++ 1 file changed, 2

Re: [PATCH v3 1/4] Btrfs-progs: Support UUID tree and UUID items in btrfs-debug-tree

2013-05-16 Thread Stefan Behrens
On 05/16/2013 18:19, David Sterba wrote: On Thu, May 16, 2013 at 04:45:55PM +0200, Stefan Behrens wrote: +struct btrfs_uuid_item { + __le16 type;/* refer to BTRFS_UUID_ITEM_TYPE* defines above */ + __le32 len; /* number of following 64bit values */ + __le64 data[0

Re: [PATCH] Btrfs: fix memory leak in replace_path

2013-05-17 Thread Stefan Behrens
On Fri, 17 May 2013 16:45:44 +0800, Liu Bo wrote: We need to unlock and free extent buffer before the return. Signed-off-by: Liu Bo bo.li@oracle.com --- fs/btrfs/relocation.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/fs/btrfs/relocation.c

Re: [PATCH] Btrfs: clear received_uuid field for new writable snapshots

2013-05-23 Thread Stefan Behrens
that are not evaluated anywhere. On Wed, Apr 17, 2013 at 12:11 PM, Stefan Behrens sbehr...@giantdisaster.de wrote: For created snapshots, the full root_item is copied from the source root and afterwards selectively modified. The current code forgets to clear the field received_uuid. The only problem

Re: Problem with btrfs send/receive

2013-05-23 Thread Stefan Behrens
On Thu, 23 May 2013 13:51:59 +0200, Felix Blanke wrote: Hi everyone, I was trying the new send/receive feature today but can't make it work. These are the commands I was using: btrfs subvol snap -r /mnt/data1/@downloads/ /mnt/data1/snapshots/testsnap btrfs send

[PATCH] Btrfs-progs: add option to btrfs-debug-tree to print uuid tree only

2013-05-27 Thread Stefan Behrens
Signed-off-by: Stefan Behrens sbehr...@giantdisaster.de --- debug-tree.c | 31 ++- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/debug-tree.c b/debug-tree.c index 0fc0ecd..dce1d81 100644 --- a/debug-tree.c +++ b/debug-tree.c @@ -30,13 +30,14

Re: oops at mount

2013-05-30 Thread Stefan Behrens
On Thu, 30 May 2013 08:32:35 -0400, Josef Bacik wrote: On Thu, May 30, 2013 at 05:17:06AM -0600, Papp Tamas wrote: hi All, I'm new on the list. System: Distributor ID: Ubuntu Description: Ubuntu 13.04 Release: 13.04 Codename:raring Linux ctu 3.8.0-19-generic #30-Ubuntu SMP

Re: oops at mount

2013-05-30 Thread Stefan Behrens
On Thu, 30 May 2013 10:03:29 -0400, Chris Mason wrote: Quoting Stefan Behrens (2013-05-30 08:55:58) Papp is using an Intel X18-M/X25-M/X25-V G2 SSD. At least with an Intel X25 SSD that identifies itself with INTEL SSDSA2M080 and on one with the ID INTEL SSDSA2M040, I've tested whether

Re: oops at mount

2013-05-30 Thread Stefan Behrens
On 05/30/2013 13:17, Papp Tamas wrote: hi All, I'm new on the list. System: Distributor ID:Ubuntu Description:Ubuntu 13.04 Release:13.04 Codename:raring Linux ctu 3.8.0-19-generic #30-Ubuntu SMP Wed May 1 16:35:23 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux The symptom is the

Re: wait_block_group_cache_progress() waits forever in case of drive failure

2013-06-05 Thread Stefan Behrens
On Tue, 4 Jun 2013 19:23:18 +0300, Alex Lyakas wrote: [...] P.S: should I open a bugzilla for this? Yes. Otherwise the bug report gets lost. -- To unsubscribe from this list: send the line unsubscribe linux-btrfs in the body of a message to majord...@vger.kernel.org More majordomo info at

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

2013-06-07 Thread Stefan Behrens
the issue that the uuid-tree was not using the transaction block reserve. v3 - v4: - Fixed a bug. A corrupted UUID tree entry could have caused an endless loop in the check+rescan thread. Stefan Behrens (8): Btrfs: introduce a tree for items that map UUIDs to something Btrfs: support

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

2013-06-07 Thread Stefan Behrens
are successfully completed. Signed-off-by: Stefan Behrens sbehr...@giantdisaster.de --- fs/btrfs/ctree.h | 4 ++ fs/btrfs/disk-io.c | 18 +- fs/btrfs/transaction.c | 3 +- fs/btrfs/uuid-tree.c | 157 + fs/btrfs/volumes.c | 83

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

2013-06-07 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 v4 2/8] Btrfs: support printing UUID tree elements

2013-06-07 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 | 81 +++ 1 file changed, 81 insertions(+) diff --git a/fs/btrfs/print-tree.c b/fs/btrfs/print

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

2013-06-07 Thread Stefan Behrens
-by: Stefan Behrens sbehr...@giantdisaster.de --- fs/btrfs/ctree.h | 1 + fs/btrfs/disk-io.c | 34 ++ fs/btrfs/extent-tree.c | 3 +++ fs/btrfs/volumes.c | 26 ++ fs/btrfs/volumes.h | 1 + 5 files changed, 65 insertions

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

2013-06-07 Thread Stefan Behrens
for no good reason is also not good. That's the justification why a completely new tree was introduced. Signed-off-by: Stefan Behrens sbehr...@giantdisaster.de --- fs/btrfs/Makefile| 3 +- fs/btrfs/ctree.h | 50 ++ fs/btrfs/uuid-tree.c | 480

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

2013-06-07 Thread Stefan Behrens
of the subvolume. The latter is also done when read-only snapshots are created which inherit all the send/receive information from the parent subvolume. User mode programs use the BTRFS_IOC_TREE_SEARCH ioctl to search and read in the UUID tree. Signed-off-by: Stefan Behrens sbehr...@giantdisaster.de --- fs

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

2013-06-07 Thread Stefan Behrens
is still running, the unmount is delayed until the UUID tree building task is finished. Signed-off-by: Stefan Behrens sbehr...@giantdisaster.de --- fs/btrfs/ctree.h | 3 ++ fs/btrfs/disk-io.c | 5 ++ fs/btrfs/volumes.c | 150 - 3 files changed

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

2013-06-07 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 ++- fs

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

2013-06-07 Thread Stefan Behrens
On 06/07/2013 16:39, Josef Bacik wrote: On Fri, Jun 07, 2013 at 04:27:51AM -0600, Stefan Behrens wrote: 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

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

2013-06-20 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 v5 3/8] Btrfs: create UUID tree if required

2013-06-20 Thread Stefan Behrens
-by: Stefan Behrens sbehr...@giantdisaster.de --- fs/btrfs/ctree.h | 1 + fs/btrfs/disk-io.c | 34 ++ fs/btrfs/extent-tree.c | 3 +++ fs/btrfs/volumes.c | 26 ++ fs/btrfs/volumes.h | 1 + 5 files changed, 65 insertions

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

2013-06-20 Thread Stefan Behrens
for no good reason is also not good. That's the justification why a completely new tree was introduced. Signed-off-by: Stefan Behrens sbehr...@giantdisaster.de --- fs/btrfs/Makefile| 3 +- fs/btrfs/ctree.h | 50 ++ fs/btrfs/uuid-tree.c | 480

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

2013-06-20 Thread Stefan Behrens
of the subvolume. The latter is also done when read-only snapshots are created which inherit all the send/receive information from the parent subvolume. User mode programs use the BTRFS_IOC_TREE_SEARCH ioctl to search and read in the UUID tree. Signed-off-by: Stefan Behrens sbehr...@giantdisaster.de --- fs

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

2013-06-20 Thread Stefan Behrens
are successfully completed. Signed-off-by: Stefan Behrens sbehr...@giantdisaster.de --- fs/btrfs/ctree.h | 4 ++ fs/btrfs/disk-io.c | 17 +- fs/btrfs/transaction.c | 3 +- fs/btrfs/uuid-tree.c | 156 + fs/btrfs/volumes.c | 82

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

2013-06-20 Thread Stefan Behrens
of the uuid tree rescan thread. Now a struct completion is used instead of a struct semaphore. Stefan Behrens (8): Btrfs: introduce a tree for items that map UUIDs to something Btrfs: support printing UUID tree elements Btrfs: create UUID tree if required Btrfs: maintain subvolume items

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

2013-06-20 Thread Stefan Behrens
is still running, the unmount is delayed until the UUID tree building task is finished. Signed-off-by: Stefan Behrens sbehr...@giantdisaster.de --- fs/btrfs/ctree.h | 2 + fs/btrfs/disk-io.c | 6 +++ fs/btrfs/volumes.c | 148 - 3 files changed

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

2013-06-20 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 ++- fs

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

2013-06-21 Thread Stefan Behrens
On Thu, 20 Jun 2013 12:47:04 -0700, Zach Brown wrote: +/* for items that use the BTRFS_UUID_KEY */ +#define BTRFS_UUID_ITEM_TYPE_SUBVOL 0 /* for UUIDs assigned to subvols */ +#define BTRFS_UUID_ITEM_TYPE_RECEIVED_SUBVOL1 /* for UUIDs assigned to +

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

2013-06-24 Thread Stefan Behrens
On Fri, 21 Jun 2013 09:11:38 -0700, Zach Brown wrote: + offset = (unsigned long)ptr; + while (sub_item_len 0) { + u64 data; + + read_extent_buffer(eb, data, offset, sizeof(data)); + data = le64_to_cpu(data); + if (data == subid) { +

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

2013-06-26 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 v6 4/8] Btrfs: maintain subvolume items in the UUID tree

2013-06-26 Thread Stefan Behrens
of the subvolume. The latter is also done when read-only snapshots are created which inherit all the send/receive information from the parent subvolume. User mode programs use the BTRFS_IOC_TREE_SEARCH ioctl to search and read in the UUID tree. Signed-off-by: Stefan Behrens sbehr...@giantdisaster.de --- fs

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

2013-06-26 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 | 25 + 1 file changed, 25 insertions(+) diff --git a/fs/btrfs/print-tree.c b/fs/btrfs/print-tree.c index dc0024f

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

2013-06-26 Thread Stefan Behrens
is still running, the unmount is delayed until the UUID tree building task is finished. Signed-off-by: Stefan Behrens sbehr...@giantdisaster.de --- fs/btrfs/ctree.h | 2 + fs/btrfs/disk-io.c | 6 +++ fs/btrfs/volumes.c | 148 - 3 files changed

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

2013-06-26 Thread Stefan Behrens
-by: Stefan Behrens sbehr...@giantdisaster.de --- fs/btrfs/ctree.h | 1 + fs/btrfs/disk-io.c | 34 ++ fs/btrfs/extent-tree.c | 3 +++ fs/btrfs/volumes.c | 26 ++ fs/btrfs/volumes.h | 1 + 5 files changed, 65 insertions

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

2013-06-26 Thread Stefan Behrens
for no good reason is also not good. That's the justification why a completely new tree was introduced. Signed-off-by: Stefan Behrens sbehr...@giantdisaster.de --- fs/btrfs/Makefile| 3 +- fs/btrfs/ctree.h | 30 ++ fs/btrfs/uuid-tree.c | 281

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

2013-06-26 Thread Stefan Behrens
are successfully completed. Signed-off-by: Stefan Behrens sbehr...@giantdisaster.de --- fs/btrfs/ctree.h | 4 ++ fs/btrfs/disk-io.c | 17 ++- fs/btrfs/transaction.c | 3 +- fs/btrfs/uuid-tree.c | 121 + fs/btrfs/volumes.c | 82

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

2013-06-26 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 ++- fs

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

2013-06-26 Thread Stefan Behrens
in the btrfs-progs code. Stefan Behrens (8): Btrfs: introduce a tree for items that map UUIDs to something Btrfs: support printing UUID tree elements Btrfs: create UUID tree if required Btrfs: maintain subvolume items in the UUID tree Btrfs: fill UUID tree initially Btrfs: introduce

[PATCH v4 1/5] Btrfs-progs: Support UUID tree and UUID items in btrfs-debug-tree

2013-06-26 Thread Stefan Behrens
Support printing these things. Signed-off-by: Stefan Behrens sbehr...@giantdisaster.de --- ctree.h | 15 +++ print-tree.c | 46 +++--- 2 files changed, 58 insertions(+), 3 deletions(-) diff --git a/ctree.h b/ctree.h index 3fe14b0..f959573

[PATCH v4 3/5] Btrfs-progs: use UUID tree for send/receive

2013-06-26 Thread Stefan Behrens
that allow to quickly search for a given UUID and to retrieve data that is assigned to this UUID, like which subvolume ID is related to this UUID. Signed-off-by: Stefan Behrens sbehr...@giantdisaster.de --- cmds-receive.c | 23 ++- cmds-send.c| 53 +-- send-utils.c | 477

[PATCH v4 0/5] Btrfs-progs: speedup btrfs send/receive

2013-06-26 Thread Stefan Behrens
. v2 - v3: - Shrinked the uuid_item (this was a review comment from Liu Bo). v3 - v4: - Use the type field in the key to distinguish the UUID tree item types. Stefan Behrens (5): Btrfs-progs: Support UUID tree and UUID items in btrfs-debug-tree Btrfs-progs: add UUID tree lookup methods Btrfs

[PATCH v4 2/5] Btrfs-progs: add UUID tree lookup methods

2013-06-26 Thread Stefan Behrens
This commit adds UUID tree lookup methods that make use of the search ioctl. The code is based on the kernel code. Signed-off-by: Stefan Behrens sbehr...@giantdisaster.de --- Makefile| 5 +-- ctree.h | 5 +++ uuid-tree.c | 104

[PATCH v4 4/5] Btrfs-progs: add uuid_tree_gen field to btrfs-show-super

2013-06-26 Thread Stefan Behrens
Signed-off-by: Stefan Behrens sbehr...@giantdisaster.de --- btrfs-show-super.c | 2 ++ ctree.h| 5 - 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/btrfs-show-super.c b/btrfs-show-super.c index f587f10..c815469 100644 --- a/btrfs-show-super.c +++ b/btrfs-show

[PATCH v4 5/5] Btrfs-progs: add option to btrfs-debug-tree to print uuid tree only

2013-06-26 Thread Stefan Behrens
Signed-off-by: Stefan Behrens sbehr...@giantdisaster.de --- btrfs-debug-tree.c | 31 ++- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/btrfs-debug-tree.c b/btrfs-debug-tree.c index bae7f94..c0eae9b 100644 --- a/btrfs-debug-tree.c +++ b/btrfs-debug

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

2013-06-26 Thread Stefan Behrens
On 06/26/2013 21:55, Zach Brown wrote: + if (!uuid_root) { + WARN_ON_ONCE(1); + ret = -ENOENT; + goto out; + } WARN_ON_ONCE specifically returns the condition so that you can write: if (WARN_ON_ONCE(!uuid_root)) {

Re: btrfs send /receive : having problems sending a snapshot back to the original partition

2013-07-02 Thread Stefan Behrens
On Tue, 02 Jul 2013 10:56:18 +0100, Miguel Negrão wrote: Seg, 2013-07-01 às 17:50 +0200, Stefan Behrens escreveu: What you are trying to do is not possible, it is not supported. Btrfs send/receive can be used to create backups. The use case to restore from backups is not addressed. Ok, I

Re: [PATCH RESEND] Btrfs-progs: fix compile warning in btrfs_free_block_groups()

2013-07-03 Thread Stefan Behrens
On Thu, 4 Jul 2013 00:24:45 +0800, Wang Shilong wrote: From: Wang Shilong wangsl-f...@cn.fujitsu.com extent-tree.c: In function 'btrfs_free_block_groups': extent-tree.c:3189:12: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] Signed-off-by: Wang Shilong

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

2013-07-03 Thread Stefan Behrens
-by: Stefan Behrens sbehr...@giantdisaster.de --- fs/btrfs/ctree.h | 1 + fs/btrfs/disk-io.c | 34 ++ fs/btrfs/extent-tree.c | 3 +++ fs/btrfs/volumes.c | 26 ++ fs/btrfs/volumes.h | 1 + 5 files changed, 65 insertions

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

2013-07-03 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 v7 5/8] Btrfs: fill UUID tree initially

2013-07-03 Thread Stefan Behrens
is still running, the unmount is delayed until the UUID tree building task is finished. Signed-off-by: Stefan Behrens sbehr...@giantdisaster.de --- fs/btrfs/ctree.h | 2 + fs/btrfs/disk-io.c | 6 +++ fs/btrfs/volumes.c | 149 - 3 files changed

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

2013-07-03 Thread Stefan Behrens
of the subvolume. The latter is also done when read-only snapshots are created which inherit all the send/receive information from the parent subvolume. User mode programs use the BTRFS_IOC_TREE_SEARCH ioctl to search and read in the UUID tree. Signed-off-by: Stefan Behrens sbehr...@giantdisaster.de --- fs

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

2013-07-03 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 ++- fs

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

2013-07-03 Thread Stefan Behrens
in the btrfs-progs code. v6 - v7: - WARN_ON_ONCE specifically returns the condition. - Eliminate the sparse warnings that CF=-D__CHECK_ENDIAN__ produces. - Have callers pass in the key type to the search functions and remove the specific search functions. Stefan Behrens (8): Btrfs: introduce

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

2013-07-03 Thread Stefan Behrens
for no good reason is also not good. That's the justification why a completely new tree was introduced. Signed-off-by: Stefan Behrens sbehr...@giantdisaster.de --- fs/btrfs/Makefile| 3 +- fs/btrfs/ctree.h | 24 ++ fs/btrfs/uuid-tree.c | 235

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

2013-07-03 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 dc0024f

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

2013-07-03 Thread Stefan Behrens
are successfully completed. Signed-off-by: Stefan Behrens sbehr...@giantdisaster.de --- fs/btrfs/ctree.h | 4 ++ fs/btrfs/disk-io.c | 17 ++- fs/btrfs/transaction.c | 3 +- fs/btrfs/uuid-tree.c | 123 + fs/btrfs/volumes.c | 82

Re: [PATCH] Btrfs: fix wrong write offset when replacing a device

2013-07-04 Thread Stefan Behrens
On Thu, 4 Jul 2013 18:37:21 +0800, Miao Xie wrote: The filesystem was corrupted after we did a device replace. Steps to reproduce: # mkfs.btrfs -f -m single -d raid10 device0..device3 # mount device0 mnt # btrfs replace start -rfB 1 device4 mnt # umount mnt # btrfsck device4 The

[PATCH] Btrfs: fix wrong write offset when replacing a device

2013-07-04 Thread Stefan Behrens
...@cn.fujitsu.com Signed-off-by: Stefan Behrens sbehr...@giantdisaster.de --- fs/btrfs/scrub.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c index 4ba2a69..64a157b 100644 --- a/fs/btrfs/scrub.c +++ b/fs/btrfs/scrub.c @@ -2495,7 +2495,7

  1   2   3   4   5   >