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 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

[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

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

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

[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: [PATCH] btrfs-progs: image: handle superblocks correctly on fs with big blocks

2013-05-07 Thread Stefan Behrens
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 they're wrong. Signed-off-by: David Sterba dste...@suse.cz --- btrfs-image.c | 27

[PATCH] Btrfs: fix a comment

2013-05-07 Thread Stefan Behrens
it in the comment. Signed-off-by: Stefan Behrens sbehr...@giantdisaster.de --- fs/btrfs/ctree.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c index 566d99b..85e158e 100644 --- a/fs/btrfs/ctree.c +++ b/fs/btrfs/ctree.c @@ -4381,7 +4381,7 @@ void

[PATCH] Btrfs: don't allow device replace on RAID5/RAID6

2013-05-07 Thread Stefan Behrens
= -ENOMEM; 4925goto out; 4926} 4927 There might be more issues. Until this is really tested, don't allow users to start the procedure on RAID5/RAID6 filesystems. Signed-off-by: Stefan Behrens sbehr...@giantdisaster.de --- fs/btrfs/dev

[PATCH] Btrfs-progs: Add uuid-tree.o to libbtrfs.a

2013-04-29 Thread Stefan Behrens
Since send-utils.o needs it and send-utils.o is part of the exported libbtrfs functionality. Signed-off-by: Stefan Behrens sbehr...@giantdisaster.de --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 98aa87e..589c60d 100644 --- a/Makefile

Re: [PATCH 5/5] Btrfs: fill UUID tree initially

2013-04-29 Thread Stefan Behrens
On Mon, 29 Apr 2013 17:12:20 +0200, David Sterba wrote: On Fri, Apr 19, 2013 at 05:41:06PM +0200, Stefan Behrens wrote: [...] +up(fs_info-uuid_scan_sem); Does lockdep need to be instructed that a semaphore is released in a different thread it's been taken? Not sure if this wasn't

Re: device delete to get errors from the kernel

2013-04-26 Thread Stefan Behrens
On Fri, 26 Apr 2013 17:39:16 +0800, Anand Jain wrote: As showed in the previous email in this thread, we need to get the error string from the kernel to the cli to improve the usability of the product. As also said, I was looking at two way which I think we could do this, here I take

[PATCH] Btrfs-progs: btrfs-send: free used memory and close fds

2013-04-23 Thread Stefan Behrens
Not important at all since exit() is called afterwards and this is not part of the library. It just makes valgrind happy and thus allows to search for real flaws. Signed-off-by: Stefan Behrens sbehr...@giantdisaster.de --- cmds-send.c | 30 +++--- 1 file changed, 23

[PATCH] Btrfs-progs: in btrfs-debug-tree, print -1 in key for (u64)-1

2013-04-23 Thread Stefan Behrens
For the objectid and offset field of a key, print -1 instead of the decimal representation of 0x. At least for me it is more readable like this. Signed-off-by: Stefan Behrens sbehr...@giantdisaster.de --- print-tree.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion

[PATCH] Btrfs-progs: add function to map subvol ID to path

2013-04-23 Thread Stefan Behrens
adds a function that is able to map a subvolume ID to a filesystem path with an effort that is independent of the number of existing subvolumes. In addition to this function, a command line frontend is added as well: btrfs inspect-internal subvolid-resolve subvolid path Signed-off-by: Stefan

[PATCH 0/3] speedup btrfs send/receive

2013-04-23 Thread Stefan Behrens
to Btrfs-progs and changes the send/receive tools to use it. Stefan Behrens (3): 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 Makefile | 2 +- cmds-receive.c | 23 ++- cmds

[PATCH 2/3] Btrfs-progs: add uuid-tree lookup methods

2013-04-23 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| 2 +- ctree.h | 5 ++ uuid-tree.c | 196

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

2013-04-23 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 1/3] Btrfs-progs: Support UUID tree and UUID items in btrfs-debug-tree

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

[PATCH] Btrfs-progs: btrfs-crc: support specifying checksum in hex

2013-04-22 Thread Stefan Behrens
Signed-off-by: Stefan Behrens sbehr...@giantdisaster.de --- btrfs-crc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/btrfs-crc.c b/btrfs-crc.c index 6e21a0e..e4cda43 100644 --- a/btrfs-crc.c +++ b/btrfs-crc.c @@ -49,7 +49,7 @@ int main(int argc, char **argv

Re: [PATCH] btrfs-progs: subvol show could take more than one subvol

2013-04-19 Thread Stefan Behrens
On Fri, 19 Apr 2013 17:38:29 +0800, Anand Jain wrote: Signed-off-by: Anand Jain anand.j...@oracle.com --- cmds-subvolume.c | 12 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/cmds-subvolume.c b/cmds-subvolume.c index 74e2130..e3b8032 100644 ---

[PATCH] Btrfs: delete unused parameter to btrfs_read_root_item()

2013-04-19 Thread Stefan Behrens
Signed-off-by: Stefan Behrens sbehr...@giantdisaster.de --- fs/btrfs/ctree.h | 5 ++--- fs/btrfs/disk-io.c | 2 +- fs/btrfs/root-tree.c | 7 +++ 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h index 412c306..84be717 100644 --- a/fs

[PATCH] Btrfs: set UUID in root_item for created trees

2013-04-19 Thread Stefan Behrens
. These UUID are never used so far, but anyway, since it is better to have it uniform for all trees, this commit adds some lines that generate and write an UUID for newly created trees. Signed-off-by: Stefan Behrens sbehr...@giantdisaster.de --- fs/btrfs/disk-io.c | 4 1 file changed, 4 insertions

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

2013-04-19 Thread Stefan Behrens
is also not good. That's the justification why a completely new tree was introduced. Stefan Behrens (5): 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

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

2013-04-19 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 2/5] Btrfs: support printing UUID tree elements

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

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

2013-04-19 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 | 149 - 3 files changed

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

2013-04-19 Thread Stefan Behrens
-by: Stefan Behrens sbehr...@giantdisaster.de --- fs/btrfs/ctree.h | 1 + fs/btrfs/disk-io.c | 38 +- fs/btrfs/volumes.c | 23 +++ fs/btrfs/volumes.h | 2 ++ 4 files changed, 63 insertions(+), 1 deletion(-) diff --git a/fs/btrfs/ctree.h b/fs

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

2013-04-19 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 | 497

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

2013-04-17 Thread Stefan Behrens
the received_uuid field for new writable snapshots. - don't clear the send/receive related information like the stransid for read-only snapshots (which makes them useable as a parent for the automatic selection of parents in the receive code). Signed-off-by: Stefan Behrens sbehr...@giantdisaster.de

Re: [PATCH] Btrfs-progs: add a free space cache checker to fsck V2

2013-04-15 Thread Stefan Behrens
On Thu, 4 Apr 2013 09:57:50 -0400, Josef Bacik wrote: In trying to track down a weird tree log problem I wanted to make sure that the free space cache was actually valid, which we currently have no way of doing. So this patch adds a bunch of support for the free space cache code and then a

Re: [PATCH v2 4/4] Btrfs-progs: enhance 'btrfs subvolume list'

2013-04-12 Thread Stefan Behrens
On Fri, 12 Apr 2013 08:58:27 +0800, Wang Shilong wrote: btrfs subvolume list gets a new option --fields=... which allows to specify which pieces of information about subvolumes shall be printed. This is necessary because this commit also adds all the so far missing items from the root_item

[PATCH v3 3/4] Btrfs-progs: add more subvol fields to btrfs-list

2013-04-12 Thread Stefan Behrens
The parent UUID, all generation values and all timestamps that are available in the root_item are added. Signed-off-by: Stefan Behrens sbehr...@giantdisaster.de --- v2 - v3: - After Wang Shilong explained the purpose of one part of the code where I added a TODO: what is it good for? comment

[PATCH] Btrfs-progs: enhance 'btrfs subvolume list'

2013-04-11 Thread Stefan Behrens
values. The parameters to the --fields option is a list of items to print: --fields=gen,dirid,uuid,puuid,ruuid,cgen,ogen,sgen,rgen,ctime,otime, stime,rtime,path,rootid,parent,topid,all Signed-off-by: Stefan Behrens sbehr...@giantdisaster.de --- btrfs-list.c | 418

[PATCH v2 1/4] Btrfs-progs: cleanup in btrfs-list.c

2013-04-11 Thread Stefan Behrens
Since someone modified the code to initialize all need_print with zero, these lines can be removed entirely. Signed-off-by: Stefan Behrens sbehr...@giantdisaster.de --- btrfs-list.c | 12 +--- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/btrfs-list.c b/btrfs-list.c index

[PATCH v2 3/4] Btrfs-progs: add more subvol fields to btrfs-list

2013-04-11 Thread Stefan Behrens
The parent UUID, all generation values and all timestamps that are available in the root_item are added. Signed-off-by: Stefan Behrens sbehr...@giantdisaster.de --- btrfs-list.c | 273 +++ btrfs-list.h | 39 - 2 files changed, 197

[PATCH v2 2/4] Btrfs-progs: make the btrfs-list output more compact

2013-04-11 Thread Stefan Behrens
The following commit will add many additional columns to the output. Therefore the current commit adds a width for each column. It replaces to uncondionally add a TAB after each column which makes the output much wider than necessary. Signed-off-by: Stefan Behrens sbehr...@giantdisaster.de

[PATCH v2 4/4] Btrfs-progs: enhance 'btrfs subvolume list'

2013-04-11 Thread Stefan Behrens
values. The parameters to the --fields option is a list of items to print: --fields=gen,dirid,uuid,puuid,ruuid,cgen,ogen,sgen,rgen,ctime,otime, stime,rtime,path,rootid,parent,topid,all Signed-off-by: Stefan Behrens sbehr...@giantdisaster.de --- btrfs-list.c | 58

[PATCH 08/17 v2] Btrfs-progs: Set the root-id for received subvols in btrfs receive

2013-04-10 Thread Stefan Behrens
When an entry was added to the subvol search tree, the root_id was always 0 (not set at all) and therefore only the first one was added, all the others had been ignored. This commit sets the root_id before the entry is added. Signed-off-by: Stefan Behrens sbehr...@giantdisaster.de --- v1 - v2

[PATCH] Btrfs: allow omitting stream header and end-cmd for btrfs send

2013-04-10 Thread Stefan Behrens
compatible. You could compare the old behaviour of the Btrfs send stream to the one of ftp where you need a seperate request/response channel and newly opened data transfer channels for each file, while the new behaviour is more like http using a single stream for everything. Signed-off-by: Stefan

[PATCH] Btrfs-progs: add send option for using new end-cmd semantic

2013-04-10 Thread Stefan Behrens
perfect for this purpose. Signed-off-by: Stefan Behrens sbehr...@giantdisaster.de --- cmds-send.c | 35 +++ ioctl.h | 15 ++- 2 files changed, 45 insertions(+), 5 deletions(-) diff --git a/cmds-send.c b/cmds-send.c index 9bb4206..adfb67d 100644

Re: Backup Options

2013-04-09 Thread Stefan Behrens
On Tue, 9 Apr 2013 16:13:22 +0300, Alex Lyakas wrote: Hi David, maybe my old patch http://www.spinics.net/lists/linux-btrfs/msg19739.html can help this issue? The utimensat() call in process_utimes() needs the AT_FDCWD parameter to be able to receive to relative directories. I'm currently

[PATCH 00/17] Btrfs-progs: some receive related patches

2013-04-09 Thread Stefan Behrens
://btrfs.giantdisaster.de/git/btrfs-progs recv1 Alex Lyakas (1): btrfs-progs: Fix the receive code pathing Stefan Behrens (16): Btrfs-progs: Use /proc/mounts instead of /etc/mtab Btrfs-progs: ignore subvols above BTRFS_LAST_FREE_OBJECTID Btrfs-progs: close file descriptor in cmds-send.c Btrfs-progs: fix

[PATCH 15/17] Btrfs-progs: remove some unused code

2013-04-09 Thread Stefan Behrens
Signed-off-by: Stefan Behrens sbehr...@giantdisaster.de --- send-stream.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/send-stream.c b/send-stream.c index 1a498f3..88e18e2 100644 --- a/send-stream.c +++ b/send-stream.c @@ -410,9 +410,6 @@ static int read_and_process_cmd(struct

[PATCH 03/17] Btrfs-progs: close file descriptor in cmds-send.c

2013-04-09 Thread Stefan Behrens
valgrind found this very obvious issue. Signed-off-by: Stefan Behrens sbehr...@giantdisaster.de --- cmds-send.c | 1 + 1 file changed, 1 insertion(+) diff --git a/cmds-send.c b/cmds-send.c index 5a7183d..3ba5af6 100644 --- a/cmds-send.c +++ b/cmds-send.c @@ -82,6 +82,7 @@ int find_mount_root

[PATCH 02/17] Btrfs-progs: ignore subvols above BTRFS_LAST_FREE_OBJECTID

2013-04-09 Thread Stefan Behrens
Signed-off-by: Stefan Behrens sbehr...@giantdisaster.de --- send-utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/send-utils.c b/send-utils.c index d8d3972..b1d3873 100644 --- a/send-utils.c +++ b/send-utils.c @@ -226,7 +226,7 @@ int subvol_uuid_search_init(int mnt_fd

[PATCH 05/17] Btrfs-progs: add a function to free subvol_uuid_search memory

2013-04-09 Thread Stefan Behrens
There was no way to free the memory that was used for the subvol_uuid_search functions. Since this is part of the libbtrfs, add such a cleanup function. Signed-off-by: Stefan Behrens sbehr...@giantdisaster.de --- send-utils.c | 23 +++ send-utils.h | 1 + 2 files changed, 24

[PATCH 06/17] Btrfs-progs: cleanup subvol_uuid_search memory in btrfs send/receive

2013-04-09 Thread Stefan Behrens
Call the cleanup function that was introduced with the other commit. Signed-off-by: Stefan Behrens sbehr...@giantdisaster.de --- cmds-receive.c | 1 + cmds-send.c| 2 ++ 2 files changed, 3 insertions(+) diff --git a/cmds-receive.c b/cmds-receive.c index 6688d0c..fc5094e 100644 --- a/cmds

[PATCH 04/17] Btrfs-progs: fix a small memory leak in btrfs-list.c

2013-04-09 Thread Stefan Behrens
valgrind found this very obvious issue. Signed-off-by: Stefan Behrens sbehr...@giantdisaster.de --- btrfs-list.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/btrfs-list.c b/btrfs-list.c index a748d5e..38e7e53 100644 --- a/btrfs-list.c +++ b/btrfs-list.c

[PATCH 01/17] Btrfs-progs: Use /proc/mounts instead of /etc/mtab

2013-04-09 Thread Stefan Behrens
/etc/mtab is not working correctly in situations where multiple mount namespaces are used. Use /proc/mounts instead like the rest of the code is doing it. Signed-off-by: Stefan Behrens sbehr...@giantdisaster.de --- cmds-send.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH 16/17] Btrfs-progs: allow to receive to relative directories

2013-04-09 Thread Stefan Behrens
Signed-off-by: Stefan Behrens sbehr...@giantdisaster.de --- cmds-receive.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmds-receive.c b/cmds-receive.c index f937366..e5467d2 100644 --- a/cmds-receive.c +++ b/cmds-receive.c @@ -755,7 +755,7 @@ static int process_utimes

[PATCH 09/17] Btrfs-progs: btrfs-receive: different levels (amount) of debug output

2013-04-09 Thread Stefan Behrens
There used to be 2 levels of verbose output, now there are 3: - None at all (no -v option given). - Some information about received snapshots / subvolumes (-v option). - Each received command is printed (-vv option). Signed-off-by: Stefan Behrens sbehr...@giantdisaster.de --- cmds-receive.c | 32

[PATCH 10/17] Btrfs-progs: small parent_subvol cleanup for cmds-receive.c

2013-04-09 Thread Stefan Behrens
parent_subvol is local to process_snapshot() and not needed outside. Signed-off-by: Stefan Behrens sbehr...@giantdisaster.de --- cmds-receive.c | 14 ++ 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/cmds-receive.c b/cmds-receive.c index 8afffe6..081665f 100644

[PATCH 14/17] Btrfs-progs: Fix that BTRFS_FSID_SIZE is used instead of BTRFS_UUID_SIZE

2013-04-09 Thread Stefan Behrens
Both are 16 but it's wrong anyway to use FSID_SIZE for UUIDs. Signed-off-by: Stefan Behrens sbehr...@giantdisaster.de --- cmds-receive.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmds-receive.c b/cmds-receive.c index 50c1b97..f937366 100644 --- a/cmds-receive.c +++ b

[PATCH 11/17] Btrfs-progs: fix bug in find_root_gen

2013-04-09 Thread Stefan Behrens
A copy paste error. Signed-off-by: Stefan Behrens sbehr...@giantdisaster.de --- btrfs-list.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/btrfs-list.c b/btrfs-list.c index 38e7e53..1246a25 100644 --- a/btrfs-list.c +++ b/btrfs-list.c @@ -775,7 +775,7 @@ static u64

[PATCH 17/17] btrfs-progs: Fix the receive code pathing

2013-04-09 Thread Stefan Behrens
...@robertbuhren.de Reported-by: Rory Campbell-Lange r...@campbell-lange.net Reported-by: Stefan Priebe - Profihost AG s.pri...@profihost.ag Signed-off-by: Alex Lyakas alex.bt...@zadarastorage.com Signed-off-by: Stefan Behrens sbehr...@giantdisaster.de --- cmds-receive.c | 67

[PATCH 07/17] Btrfs-progs: free memory and close file descriptor in btrfs receive

2013-04-09 Thread Stefan Behrens
Nothing really important since this is not part of the library and at the end exit() is called. Signed-off-by: Stefan Behrens sbehr...@giantdisaster.de --- cmds-receive.c | 27 --- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/cmds-receive.c b/cmds

[PATCH 12/17] Btrfs-progs: btrfs-receive optionally honors the end-cmd

2013-04-09 Thread Stefan Behrens
(one TCP connection) to multiplex a request/response handshake plus Btrfs send streams, all in the same stream. In this case you cannot evaluate an EOF condition as an end of the Btrfs send stream. You need something else, and the end cmd is just perfect for this purpose. Signed-off-by: Stefan

[PATCH 08/17] Btrfs-progs: Set the root-id for received subvols in btrfs receive

2013-04-09 Thread Stefan Behrens
the entry is added. Signed-off-by: Stefan Behrens sbehr...@giantdisaster.de --- cmds-receive.c | 3 +++ send-utils.c | 20 send-utils.h | 1 + 3 files changed, 24 insertions(+) diff --git a/cmds-receive.c b/cmds-receive.c index dc72e9e..eedff13 100644 --- a/cmds-receive.c +++ b

[PATCH 13/17] Btrfs-progs: don't allocate one byte too much each time

2013-04-09 Thread Stefan Behrens
str1 + '/' + str2 + '\0' requires a buffer with the size strlen(str1) + strlen(str2) + 2 bytes. str1 + '/' + str2 + '/' + str3 + '\0' requires a buffer with the size strlen(str1) + strlen(str2) + strlen(str3) + 3 bytes. Signed-off-by: Stefan Behrens sbehr...@giantdisaster.de --- send-utils.c

Re: [PATCH 9/9] btrfs-progs: fix btrfs scrub start help

2013-04-05 Thread Stefan Behrens
On Fri, 5 Apr 2013 13:55:03 +0800, Anand Jain wrote: a very trivial fix Signed-off-by: Anand Jain anand.j...@oracle.com --- cmds-scrub.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmds-scrub.c b/cmds-scrub.c index 5922361..ebb0dc9 100644 --- a/cmds-scrub.c

Re: btrfs GPF in read_extent_buffer() while scrubbing with kernel 3.4.2

2013-03-27 Thread Stefan Behrens
On Tue, 3 Jul 2012 02:01:21 +0300, Sami Liedes wrote: Hi, I just got this oops on a computer running 3.4.2. A few minutes before I had started btrfs device scrub / and had a watcher process running btrfs scrub status / every 5 seconds. After a few gigabytes of scrubbing, I got this crash.

[PATCH] Btrfs-progs: Use /proc/mounts instead of /etc/mtab

2013-03-25 Thread Stefan Behrens
/etc/mtab is not working correctly in situations where multiple mount namespaces are used. Use /proc/mounts instead like the rest of the code is doing it. Signed-off-by: Stefan Behrens sbehr...@giantdisaster.de --- cmds-send.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

Re: [PATCH 3/3 V4] xfstests: btrfs tests for basic informational commands

2013-03-14 Thread Stefan Behrens
On Thu, 14 Mar 2013 08:01:54 -0500, Rich Johnston wrote: Thanks for reviewing this patch, may I put your Reviewed-by: on this version? Yes. Thanks. Reviewed-by: Stefan Behrens sbehr...@giantdisaster.de -- To unsubscribe from this list: send the line unsubscribe linux-btrfs in the body

Re: [PATCH 3/3] xfstests: btrfs tests for basic informational commands

2013-03-13 Thread Stefan Behrens
On Wed, 13 Mar 2013 09:57:03 -0500, Eric Sandeen wrote: [...] +echo == Show device stats by mountpoint +$BTRFS_UTIL_PROG device stats $SCRATCH_MNT | _filter_btrfs_device_stats Is the number of devices in SCRATCH_DEV_POOL fixed to 3? Otherwise you should pipe the device-stats-by-mountpoint

Re: [PATCH 3/3 V3] xfstests: btrfs tests for basic informational commands

2013-03-13 Thread Stefan Behrens
aio dangerous enospc rw stress +313 auto quick Reviewed-by: Stefan Behrens sbehr...@giantdisaster.de -- 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 http://vger.kernel.org/majordomo-info.html

Re: [BUG] during balance operation, WARNING: at fs/btrfs/relocation.c:1624 replace_file_extents+0x74b/0x7e0 [btrfs]()

2013-03-05 Thread Stefan Behrens
On Mon, 4 Mar 2013 14:31:37 -0500, Chris Mason wrote: On Mon, Mar 04, 2013 at 10:24:39AM -0700, Stefan Behrens wrote: Just ran the following command sequence and got lots of WARNINGs. The issue is reproducible. The box was running the cmason/for-linus that made it into Linux 3.9 RC1. #!/bin

Re: [BUG] during balance operation, WARNING: at fs/btrfs/relocation.c:1624 replace_file_extents+0x74b/0x7e0 [btrfs]()

2013-03-05 Thread Stefan Behrens
On Tue, 5 Mar 2013 15:36:33 +0100, David Sterba wrote: On Mon, Mar 04, 2013 at 06:24:39PM +0100, Stefan Behrens wrote: Just ran the following command sequence and got lots of WARNINGs. The issue is reproducible. The box was running the cmason/for-linus that made it into Linux 3.9 RC1. #!/bin

[BUG] during balance operation, WARNING: at fs/btrfs/relocation.c:1624 replace_file_extents+0x74b/0x7e0 [btrfs]()

2013-03-04 Thread Stefan Behrens
Just ran the following command sequence and got lots of WARNINGs. The issue is reproducible. The box was running the cmason/for-linus that made it into Linux 3.9 RC1. #!/bin/sh mkfs.btrfs -f /dev/sdl /dev/sdk -m raid1 -d raid1 -l 16384 mount /dev/sdl /mnt dd if=/dev/urandom of=/mnt/urandom.1GB

[PATCH] Btrfs: allow running defrag in parallel to administrative tasks

2013-03-04 Thread Stefan Behrens
exclusiveness as well. This is fixed with this commit. Signed-off-by: Stefan Behrens sbehr...@giantdisaster.de --- fs/btrfs/ioctl.c | 8 1 file changed, 8 deletions(-) diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index b908960..40631cf 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c

Re: [PATCH, RFC] btrfs-progs: require mkfs -f force option to overwrite filesystem or partition table

2013-02-20 Thread Stefan Behrens
On Thu, 14 Feb 2013 12:30:03 -0600, Eric Sandeen wrote: The core of this is shamelessly stolen from xfsprogs. Use blkid to detect an existing filesystem or partition table on any of the target devices. If something is found, require the '-f' option to overwrite it, hopefully avoiding

Re: Rebalancing RAID1

2013-02-18 Thread Stefan Behrens
On Fri, 15 Feb 2013 22:56:19 +0100 (CET), Fredrik Tolf wrote: The oops cut can be found here: http://www.dolda2000.com/~fredrik/tmp/btrfs-oops This scrub issue is fixed since Linux 3.8-rc1 with commit 4ded4f6 Btrfs: fix BUG() in scrub when first superblock reading gives EIO -- To unsubscribe

Re: [PATCH V5] Btrfs: snapshot-aware defrag

2013-02-18 Thread Stefan Behrens
On Sat, 16 Feb 2013 14:47:45 +0800, Liu Bo wrote: What about this patch(UNTESTED)? thanks, liubo diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index ca7ace7..dac9d4b 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -4142,9 +4142,14 @@ static void inode_tree_del(struct inode

Re: [PATCH] Btrfs: cleanup orphan reservation if truncate fails

2013-02-08 Thread Stefan Behrens
On Thu, 7 Feb 2013 16:28:44 -0500, Josef Bacik wrote: I noticed we were getting lots of warnings with xfstest 83 because we have reservations outstanding. This is because we moved the orphan add outside of the truncate, but we don't actually cleanup our reservation if something fails. This

Re: [PATCH 2/2] btrfs-progs: remove btrfslabel.[c|h]

2013-01-29 Thread Stefan Behrens
On Tue, 29 Jan 2013 14:24:13 +0800, Jeff Liu wrote: Clean btrfslabel.[c|h] out of the source tree and move those related functions to utils.[c|h]. Signed-off-by: Jie Liu jeff@oracle.com CC: David Sterba dste...@suse.cz CC: Gene Czarcinski g...@czarc.net --- Makefile |4

Re: [PATCH V5] Btrfs: snapshot-aware defrag

2013-01-28 Thread Stefan Behrens
, Stefan Behrens wrote: Well, the issue that I had reported on IRC some days ago which looks similar (the top part of the call trace is similar: iput - evict - destroy_inode - btrfs_destroy_inode - btrfs_add_dead_root - list_add which warns in list_add in your case and crashes in my case

Re: [PATCH 10/10] Btrfs-progs: add show subcommand to subvol cli

2013-01-25 Thread Stefan Behrens
On Fri, 25 Jan 2013 17:30:39 +0800, Anand Jain wrote: This adds show sub-command to the btrfs subvol cli to display detailed inforamtion of the given subvol or snapshot. Signed-off-by: Anand Jain anand.j...@oracle.com --- btrfs-list.c | 25 +++- btrfs-list.h | 3 +-

Re: [PATCH] Btrfs-progs: Exit if not running as root

2013-01-25 Thread Stefan Behrens
On Fri, 25 Jan 2013 06:32:30 -0500, Gene Czarcinski wrote: This patch hits a lot of files but adds little code. It could be considered a bugfix, Currently, when one of the btrfs user-space programs is executed by a regular user, the result if oftem a number of strange error messages which

Re: [PATCH] Btrfs-progs: Exit if not running as root

2013-01-25 Thread Stefan Behrens
On Fri, 25 Jan 2013 07:03:19 -0500, Gene Czarcinski wrote: On 01/25/2013 06:41 AM, Stefan Behrens wrote: On Fri, 25 Jan 2013 06:32:30 -0500, Gene Czarcinski wrote: This patch hits a lot of files but adds little code. It could be considered a bugfix, Currently, when one of the btrfs user

<    1   2   3   4   5   >