Re: [PATCH] Btrfs: do not add replace target to the alloc_list

2013-09-04 Thread Stefan Behrens
On Sun, 1 Sep 2013 18:56:44 +0300, Ilya Dryomov wrote: If replace was suspended by the umount, replace target device is added to the fs_devices-alloc_list during a later mount. This is obviously wrong. -is_tgtdev_for_dev_replace is supposed to guard against that, but

[PATCH] Btrfs-progs: fix compile warning in is_ssd()

2013-09-04 Thread Wang Shilong
mkfs.c: In function ‘is_ssd’: mkfs.c:1168:26: warning: ignoring return value of ‘blkid_devno_to_wholedisk’, declared with attribute warn_unused_result [-Wunused-result] blkid_devno_to_wholedisk(devno, wholedisk, sizeof(wholedisk), NULL); Signed-off-by: Wang Shilong wangsl.f...@cn.fujitsu.com

Re: [PATCH] rwsem: add rwsem_is_contended

2013-09-04 Thread Peter Hurley
On 09/03/2013 09:18 AM, Josef Bacik wrote: On Mon, Sep 02, 2013 at 01:18:08PM -0400, Peter Hurley wrote: On 09/01/2013 04:32 AM, Michel Lespinasse wrote: Hi Josef, On Fri, Aug 30, 2013 at 7:14 AM, Josef Bacik jba...@fusionio.com wrote: Btrfs uses an rwsem to control access to its extent

Btrfs prog

2013-09-04 Thread Giuseppe Fierro
I'm using btrfs on ubuntu 13.04 with btrfs prog v0.20-rc1 This is my configuration using 2 disks in raid1 mode: gspe@jura:/mnt$ sudo btrfs f show Label: 'UbuntuDSK' uuid: f4a3c832-f6ab-4b1d-9eb7-f9ba7d1cba01 Total devices 2 FS bytes used 205.41GB devid1 size 2.70TB used 214.03GB path

Re: [PATCH] rwsem: add rwsem_is_contended

2013-09-04 Thread Josef Bacik
On Wed, Sep 04, 2013 at 07:46:56AM -0400, Peter Hurley wrote: On 09/03/2013 09:18 AM, Josef Bacik wrote: On Mon, Sep 02, 2013 at 01:18:08PM -0400, Peter Hurley wrote: On 09/01/2013 04:32 AM, Michel Lespinasse wrote: Hi Josef, On Fri, Aug 30, 2013 at 7:14 AM, Josef Bacik jba...@fusionio.com

Re: [PATCH] rwsem: add rwsem_is_contended

2013-09-04 Thread Peter Hurley
On 09/03/2013 11:47 AM, Josef Bacik wrote: On Sun, Sep 01, 2013 at 01:32:36AM -0700, Michel Lespinasse wrote: Hi Josef, On Fri, Aug 30, 2013 at 7:14 AM, Josef Bacik jba...@fusionio.com wrote: Btrfs uses an rwsem to control access to its extent tree. Threads will hold a read lock on this

Re: Btrfs prog

2013-09-04 Thread Hugo Mills
On Wed, Sep 04, 2013 at 01:57:42PM +0200, Giuseppe Fierro wrote: I'm using btrfs on ubuntu 13.04 with btrfs prog v0.20-rc1 This is my configuration using 2 disks in raid1 mode: gspe@jura:/mnt$ sudo btrfs f show Label: 'UbuntuDSK' uuid: f4a3c832-f6ab-4b1d-9eb7-f9ba7d1cba01 Total devices

Re: Btrfs prog

2013-09-04 Thread Giuseppe Fierro
Thanks, as I can see I misunderstood the meaning of btrfs filesystem df I was expecting that the 'df' has been to display free space remaining. The -a option works Giuseppe Fierro On 4 September 2013 15:32, Hugo Mills h...@carfax.org.uk wrote: On Wed, Sep 04, 2013 at 01:57:42PM +0200, Giuseppe

Re: Btrfs prog

2013-09-04 Thread Chris Murphy
On Sep 4, 2013, at 3:32 PM, Hugo Mills h...@carfax.org.uk wrote: If I would like to show the subvolume, i get gspe@jura:/mnt$ sudo btrfs subvolume list / gspe@jura:/mnt$ nothing is shown!!! Try using the -a option. It got added a while ago, and has been a complete pain in the neck

Re: Btrfs prog

2013-09-04 Thread Wang Shilong
Hello Chris, On Sep 4, 2013, at 3:32 PM, Hugo Mills h...@carfax.org.uk wrote: If I would like to show the subvolume, i get gspe@jura:/mnt$ sudo btrfs subvolume list / gspe@jura:/mnt$ nothing is shown!!! Try using the -a option. It got added a while ago, and has been a complete

Re: Btrfs prog

2013-09-04 Thread Chris Murphy
On Sep 4, 2013, at 3:51 PM, Giuseppe Fierro giuse...@fierro.org wrote: Thanks, as I can see I misunderstood the meaning of btrfs filesystem df I was expecting that the 'df' has been to display free space remaining. Check the archives, this is a long running issue that no one has particularly

[PATCH 04/20] Btrfs-progs: fix magic return value in cmds-dedup.c

2013-09-04 Thread Wang Shilong
From: Wang Shilong wangsl.f...@cn.fujitsu.com Signed-off-by: Wang Shilong wangsl.f...@cn.fujitsu.com --- cmds-dedup.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cmds-dedup.c b/cmds-dedup.c index eb43414..674952a 100644 --- a/cmds-dedup.c +++ b/cmds-dedup.c @@ -39,7

[PATCH 00/20] fix magic return value in btrfs-progs

2013-09-04 Thread Wang Shilong
This patchset tries to fix all the magic return value in btrfs-progs. Most commands will have three kinds of return value: 0 success 1 usage of syntax errors Exceptions come from balance/scrub/replace. For example, replace cancel will return 2 if there is no operations in progress. Some tools

[PATCH 06/20] Btrfs-progs: fix magic return value in cmds-filesystem.c

2013-09-04 Thread Wang Shilong
From: Wang Shilong wangsl.f...@cn.fujitsu.com Signed-off-by: Wang Shilong wangsl.f...@cn.fujitsu.com --- cmds-filesystem.c | 28 ++-- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/cmds-filesystem.c b/cmds-filesystem.c index ca0855b..815d59a 100644 ---

[PATCH 09/20] Btrfs-progs: fix magic return value in cmds-quota.c

2013-09-04 Thread Wang Shilong
From: Wang Shilong wangsl.f...@cn.fujitsu.com Signed-off-by: Wang Shilong wangsl.f...@cn.fujitsu.com --- cmds-quota.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cmds-quota.c b/cmds-quota.c index 94e3a5c..89cc89c 100644 --- a/cmds-quota.c +++ b/cmds-quota.c @@

[PATCH 01/20] Btrfs-progs: return 1 rather than 129 in usage()

2013-09-04 Thread Wang Shilong
From: Wang Shilong wangsl.f...@cn.fujitsu.com if usage or syntax error happens, we return 1. Signed-off-by: Wang Shilong wangsl.f...@cn.fujitsu.com --- help.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/help.c b/help.c index d429a6b..09dc706 100644 --- a/help.c +++

[PATCH 03/20] Btrfs-progs: fix magic return value in cmds-chunk.c

2013-09-04 Thread Wang Shilong
From: Wang Shilong wangsl.f...@cn.fujitsu.com Signed-off-by: Wang Shilong wangsl.f...@cn.fujitsu.com --- cmds-chunk.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/cmds-chunk.c b/cmds-chunk.c index 54f0573..115db61 100644 --- a/cmds-chunk.c +++ b/cmds-chunk.c @@

[PATCH 10/20] Btrfs-progs: fix magic return value in cmds-receive.c

2013-09-04 Thread Wang Shilong
From: Wang Shilong wangsl.f...@cn.fujitsu.com Signed-off-by: Wang Shilong wangsl.f...@cn.fujitsu.com --- cmds-receive.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmds-receive.c b/cmds-receive.c index 1630f64..2b880c0 100644 --- a/cmds-receive.c +++ b/cmds-receive.c

[PATCH 08/20] Btrfs-progs: fix magic return value in cmds-qgroup.c

2013-09-04 Thread Wang Shilong
From: Wang Shilong wangsl.f...@cn.fujitsu.com Signed-off-by: Wang Shilong wangsl.f...@cn.fujitsu.com --- cmds-qgroup.c | 26 -- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/cmds-qgroup.c b/cmds-qgroup.c index 6fa4c17..ff2a1fa 100644 --- a/cmds-qgroup.c

Re: Btrfs prog

2013-09-04 Thread Wang Shilong
在 2013-9-4,下午10:10,Chris Murphy li...@colorremedies.com 写道: On Sep 4, 2013, at 3:51 PM, Giuseppe Fierro giuse...@fierro.org wrote: Thanks, as I can see I misunderstood the meaning of btrfs filesystem df I was expecting that the 'df' has been to display free space remaining. Check the

[PATCH 12/20] Btrfs-progs: fix magic return value in cmds-send.c

2013-09-04 Thread Wang Shilong
From: Wang Shilong wangsl.f...@cn.fujitsu.com If btrfs send return failure, we return 1,otherwise 0 will be returned. Signed-off-by: Wang Shilong wangsl.f...@cn.fujitsu.com --- cmds-send.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmds-send.c b/cmds-send.c index

[PATCH 14/20] Btrfs-progs: fix magic return value in btrfs-zero-log.c

2013-09-04 Thread Wang Shilong
From: Wang Shilong wangsl.f...@cn.fujitsu.com Signed-off-by: Wang Shilong wangsl.f...@cn.fujitsu.com --- btrfs-zero-log.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/btrfs-zero-log.c b/btrfs-zero-log.c index f249aec..31ec215 100644 --- a/btrfs-zero-log.c +++

[PATCH 19/20] Btrfs-progs: fix magic return value in cmds-replace.c

2013-09-04 Thread Wang Shilong
From: Wang Shilong wangsl.f...@cn.fujitsu.com There are 3 kinds of return values in replace cancel: 0: cancel successfully. 1: usage or syntal errors 2: cancel a not started or finished replacing operations. Signed-off-by: Wang Shilong wangsl.f...@cn.fujitsu.com --- cmds-replace.c | 16

[PATCH 13/20] Btrfs-progs: fix magic return value in btrfs-imgae.c

2013-09-04 Thread Wang Shilong
From: Wang Shilong wangsl.f...@cn.fujitsu.com Signed-off-by: Wang Shilong wangsl.f...@cn.fujitsu.com --- btrfs-image.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/btrfs-image.c b/btrfs-image.c index 3ea3730..ab229f3 100644 --- a/btrfs-image.c +++ b/btrfs-image.c @@

[PATCH 15/20] Btrfs-progs: fix magic return value in send-test.c

2013-09-04 Thread Wang Shilong
From: Wang Shilong wangsl.f...@cn.fujitsu.com Signed-off-by: Wang Shilong wangsl.f...@cn.fujitsu.com --- send-test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/send-test.c b/send-test.c index cb1f57d..3775f5f 100644 --- a/send-test.c +++ b/send-test.c @@ -454,5 +454,5 @@

[PATCH 16/20] Btrfs-progs: fix magic return value in dir-test.c

2013-09-04 Thread Wang Shilong
From: Wang Shilong wangsl.f...@cn.fujitsu.com Signed-off-by: Wang Shilong wangsl.f...@cn.fujitsu.com --- dir-test.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/dir-test.c b/dir-test.c index d95219a..a54b777 100644 --- a/dir-test.c +++ b/dir-test.c @@

[PATCH 17/20] Btrfs-progs: fix magic return value in random-test.c

2013-09-04 Thread Wang Shilong
From: Wang Shilong wangsl.f...@cn.fujitsu.com Signed-off-by: Wang Shilong wangsl.f...@cn.fujitsu.com --- random-test.c | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/random-test.c b/random-test.c index 2f44593..b7c6cdb 100644 --- a/random-test.c +++

[PATCH 18/20] Btrfs-progs: fix magic return value in cmds-balance.c

2013-09-04 Thread Wang Shilong
From: Wang Shilong wangsl.f...@cn.fujitsu.com If there is no balance in progress.resume/pause/cancel will return 2. For usage or syntal errors will return 1. 0 means operations return successfully. Signed-off-by: Wang Shilong wangsl.f...@cn.fujitsu.com --- cmds-balance.c | 93

[PATCH 20/20] Btrfs-progs: fix magic return value in cmds-scrub.c

2013-09-04 Thread Wang Shilong
From: Wang Shilong wangsl.f...@cn.fujitsu.com There will be four kinds of return value for command scrub start: 0: scrub dosen't find errors and return success. 1: usage or syntax errors. 3: scrub finds errors and correct all of them. 4: scrub finds errors and some of them are not correctable.

[PATCH 07/20] Btrfs-progs: fix magic return value in cmds-inspect.c

2013-09-04 Thread Wang Shilong
From: Wang Shilong wangsl.f...@cn.fujitsu.com Signed-off-by: Wang Shilong wangsl.f...@cn.fujitsu.com --- cmds-inspect.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cmds-inspect.c b/cmds-inspect.c index 9101470..bdebf7d 100644 --- a/cmds-inspect.c +++

[PATCH 05/20] Btrfs-progs: fix magic return value in cmds-device.c

2013-09-04 Thread Wang Shilong
From: Wang Shilong wangsl.f...@cn.fujitsu.com Signed-off-by: Wang Shilong wangsl.f...@cn.fujitsu.com --- cmds-device.c | 24 +--- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/cmds-device.c b/cmds-device.c index 7524d08..800a050 100644 --- a/cmds-device.c +++

[PATCH 02/20] Btrfs-progs: fix magic return value in cmds-subvolume.c

2013-09-04 Thread Wang Shilong
From: Wang Shilong wangsl.f...@cn.fujitsu.com The patch also fixes some coding styles problems. Signed-off-by: Wang Shilong wangsl.f...@cn.fujitsu.com --- cmds-subvolume.c | 45 +++-- 1 file changed, 19 insertions(+), 26 deletions(-) diff --git

Re: [PATCH 18/20] Btrfs-progs: fix magic return value in cmds-balance.c

2013-09-04 Thread Ilya Dryomov
Hi Wang, Thank you for doing the grunt work, it's been a long standing todo. See the comments below. On Wed, Sep 4, 2013 at 6:22 PM, Wang Shilong wangshilong1...@gmail.com wrote: From: Wang Shilong wangsl.f...@cn.fujitsu.com If there is no balance in progress.resume/pause/cancel will return

Newer kernels do not oops if log cannot be re-read at mount

2013-09-04 Thread Marc MERLIN
I just wanted to confirm that the crash on unexpected log read during mount is indeed fixed for me, I now just get a log read failed message. I've filed a bug with debian to encourage them to add btrfs-zero-log as a tool in the initrd so that one can have the choice of running this on a non

Re: [PATCH] xfstests: fix device lookup in btrfs/003

2013-09-04 Thread Dave Chinner
Add x...@oss.sgi.com to the cc list. On Tue, Sep 03, 2013 at 06:19:01PM -0400, Jeff Mahoney wrote: The DEVHTL lookup in btrfs/003 is broken. It can only handle full LUNs and not partitions on a disk. Rather than returning 2:0:0:0 for /dev/sdc7, it returns 'block' and we see: ./common/rc:

Re: [PATCH 00/20] fix magic return value in btrfs-progs

2013-09-04 Thread Anand Jain
On 09/04/2013 11:22 PM, Wang Shilong wrote: This patchset tries to fix all the magic return value in btrfs-progs. Most commands will have three kinds of return value: 0 success 1 usage of syntax errors Exceptions come from balance/scrub/replace. For example, replace cancel will return 2 if

[PATCH 5/5] btrfs-progs:free strdup()s that are not freed

2013-09-04 Thread Gui Hecheng
The strdup()s not freed are reported as memory leaks by valgrind. Signed-off-by: Gui Hecheng guihc.f...@cn.fujitsu.com --- cmds-subvolume.c | 48 ++-- 1 file changed, 34 insertions(+), 14 deletions(-) diff --git a/cmds-subvolume.c b/cmds-subvolume.c

[PATCH 4/5] btrfs-progs:free the local list pending_list in btrfs_scan_one_dir

2013-09-04 Thread Gui Hecheng
Originally the local pending_list is not guaranteed to be freed upon fails, it should be emptyed and the elements should be freed. Signed-off-by: Gui Hecheng guihc.f...@cn.fujitsu.com --- utils.c | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/utils.c b/utils.c

[PATCH 2/5] btrfs-progs:local variable memory freed

2013-09-04 Thread Gui Hecheng
The local probe variable in is_ssd() freed upon unsuccessful return; The local dir_head list in make_image() freed upon unsuccessful return. Signed-off-by: Gui Hecheng guihc.f...@cn.fujitsu.com --- mkfs.c | 12 +++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/mkfs.c

[PATCH 3/5] btrfs-progs: missing tree-freeing statements added

2013-09-04 Thread Gui Hecheng
The seen cache_tree in run_next_block freed. Originally, this missing causes memory leaks, reported by valgrind. Signed-off-by: Gui Hecheng guihc.f...@cn.fujitsu.com --- cmds-check.c | 5 + 1 file changed, 5 insertions(+) diff --git a/cmds-check.c b/cmds-check.c index 6cbd5a6..0cba4cc

[PATCH 0/5] Memory leaks amended

2013-09-04 Thread Gui Hecheng
Memory leaks found by the tool--valgrind along with static reviewing. Based on Daivd's branch 'integration-20130903'. Gui Hecheng (5): btrfs-progs:free local variable buf upon unsuccessful returns btrfs-progs:local variable memory freed btrfs-progs: missing tree-freeing statements added

[PATCH 1/5] btrfs-progs:free local variable buf upon unsuccessful returns

2013-09-04 Thread Gui Hecheng
The variable buf passed into find_collision() as parameter name should be freed on unsuccessful returns. Signed-off-by: Gui Hecheng guihc.f...@cn.fujitsu.com --- btrfs-image.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/btrfs-image.c b/btrfs-image.c index 3ea3730..1a52aa6 100644 ---

[PATCH V2 1/5] btrfs-progs:free strdup()s that are not freed

2013-09-04 Thread Gui Hecheng
The strdup()s not freed are reported as memory leaks by valgrind. Signed-off-by: Gui Hecheng guihc.f...@cn.fujitsu.com --- Changelog V1 - V2: - None --- cmds-subvolume.c | 40 ++-- 1 file changed, 26 insertions(+), 14 deletions(-) diff --git

[PATCH] btrfs-progs: btrfs_setup_chunk_tree_and_device_map: Return -EIO on error.

2013-09-04 Thread chandan
As a result of a successful call to btrfs_read_sys_array(), the 'ret' variable is already set to 0. Hence the function would return 0 even if the call to read_tree_block() fails. Signed-off-by: chandan chan...@linux.vnet.ibm.com --- disk-io.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)