RE: [PATCH 2/2] btrfs: Set hole_size to free space in case of contains_pending_extent

2015-02-06 Thread Zhao Lei
Hi, Filipe This was already fixed by Forrest recently. See: https://patchwork.kernel.org/patch/5776231/ Thanks for notice, I overlooked the second half of his patch... Please ignore it. Thanks Zhaolei --- fs/btrfs/volumes.c | 8 ++-- 1 file changed, 6 insertions(+), 2

RE: [PATCH 1/2] btrfs: Fix out-of-space bug caused by searching commit_root in find_free_dev_extent()

2015-02-06 Thread Zhao Lei
-search_commit_root = 1 in find_free_dev_extent(). Tested by above script, and confirmed action with many printk. Reported-by: Tsutomu Itoh t-i...@jp.fujitsu.com Signed-off-by: Zhao Lei zhao...@cn.fujitsu.com --- fs/btrfs/volumes.c | 1 - 1 file changed, 1 deletion(-) diff --git a/fs/btrfs

RE: [PATCH v2] btrfs: Fix out-of-space bug

2015-02-08 Thread Zhao Lei
Itoh t-i...@jp.fujitsu.com Signed-off-by: Zhao Lei zhao...@cn.fujitsu.com --- fs/btrfs/extent-tree.c | 4 1 file changed, 4 insertions(+) diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index a684086..67c85ff 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs

RE: [PATCH 04/15] Btrfs: add ref_count and free function for btrfs_bio

2015-01-15 Thread Zhao Lei
Hi, David Sterba * From: David Sterba [mailto:dste...@suse.cz] The cleanups look good in general, some minor nitpicks below. On Tue, Jan 13, 2015 at 08:34:37PM +0800, Zhaolei wrote: - kfree(bbio); + put_btrfs_bio(bbio); Please rename it to btrfs_put_bbio, this is

RE: [PATCH 01/10] btrfs: Adjust commit-transaction condition to avoid NO_SPACE more

2015-02-17 Thread Zhao Lei
Hi, From: Zhaolei [mailto:zhao...@cn.fujitsu.com] Subject: [PATCH 01/10] btrfs: Adjust commit-transaction condition to avoid NO_SPACE more Sorry for title, it is only one patch. Will resend. Thanks Zhaolei From: Zhao Lei zhao...@cn.fujitsu.com If we have any chance to make

RE: [PATCH v2] Btrfs: fix BUG_ON in btrfs_orphan_add() when delete unused block group

2015-02-10 Thread Zhao Lei
Hi, Liu Removing large amount of block group in a transaction may encounters BUG_ON() in btrfs_orphan_add(). That is becuase btrfs_orphan_reserve_metadata() Not big matter, s/becuase/because Thanks Zhaolei will grab metadata reservation from transaction handle, and

RE: [PATCH v2] fix utility required warning with empty utility name

2015-03-29 Thread Zhao Lei
utility required warning with empty utility name On Mon, Mar 16, 2015 at 9:14 AM, Zhaolei zhao...@cn.fujitsu.com wrote: From: Zhao Lei zhao...@cn.fujitsu.com In generic/019, if we hadn't install fio, we will get following output: FSTYP -- btrfs PLATFORM -- Linux/x86_64

RE: [PATCH] Btrfs: fix allocation size calculations in alloc_btrfs_bio

2015-02-22 Thread Zhao Lei
Hi, Chris Mason * From: Chris Mason [mailto:c...@fb.com] Sent: Friday, February 20, 2015 10:00 AM To: linux-btrfs; Zhao Lei; dste...@suse.cz Subject: [PATCH] Btrfs: fix allocation size calculations in alloc_btrfs_bio Since commit 8e5cfb55d3f (Btrfs: Make raid_map array be inlined

RE: [PULL] [PATCH 00/11] Cleanups for 4.1

2015-02-25 Thread Zhao Lei
Hi, David * From: linux-btrfs-ow...@vger.kernel.org Subject: [PULL] [PATCH 00/11] Cleanups for 4.1 Hi, a few cleanups that accumulated over time. No real fixes but there are changes that may touch functionality (no fstests complaints though). I like these cleanups. But it cause

RE: [PATCH 3/3] btrfs: Remove BUG_ON() when failed searching block_group_cache in unpin_extent_range()

2015-02-26 Thread Zhao Lei
Hi, David Manana * From: Filipe David Manana [mailto:fdman...@gmail.com] Sent: Thursday, February 26, 2015 5:55 PM To: Zhao Lei Cc: linux-btrfs@vger.kernel.org Subject: Re: [PATCH 3/3] btrfs: Remove BUG_ON() when failed searching block_group_cache in unpin_extent_range() On Wed, Feb 25

RE: [PATCH 3/3] btrfs: Remove BUG_ON() when failed searching block_group_cache in unpin_extent_range()

2015-02-24 Thread Zhao Lei
Hi, Filipe From: Filipe David Manana [mailto:fdman...@gmail.com] On Tue, Feb 24, 2015 at 3:37 PM, Zhaolei zhao...@cn.fujitsu.com wrote: From: Zhao Lei zhao...@cn.fujitsu.com Above BUG_ON() was triggered only one time in my test, but hadn't happened again in same env. The reason

RE: [PATCH 1/1] btrfs: Fix NO_SPACE bug caused by delayed-iput

2015-02-26 Thread Zhao Lei
Hi, David Sterba * From: David Sterba [mailto:dste...@suse.cz] Sent: Friday, February 27, 2015 6:29 AM To: Zhaolei Cc: linux-btrfs@vger.kernel.org Subject: Re: [PATCH 1/1] btrfs: Fix NO_SPACE bug caused by delayed-iput On Thu, Feb 26, 2015 at 11:20:23AM +0800, Zhaolei wrote: ---

RE: [PATCH 8/9] btrfs: wait for delayed iputs on no space

2015-04-13 Thread Zhao Lei
Hi, Chris -Original Message- From: Chris Mason [mailto:c...@fb.com] Sent: Monday, April 13, 2015 10:55 PM To: Zhaolei; linux-btrfs@vger.kernel.org Subject: Re: [PATCH 8/9] btrfs: wait for delayed iputs on no space On 04/09/2015 12:34 AM, Zhaolei wrote: From: Zhao Lei zhao

RE: [PATCH 4/4] Btrfs: fix device replace of a missing RAID 5/6 device

2015-06-11 Thread Zhao Lei
Hi, Omar Sandoval -Original Message- From: linux-btrfs-ow...@vger.kernel.org [mailto:linux-btrfs-ow...@vger.kernel.org] On Behalf Of Omar Sandoval Sent: Monday, May 11, 2015 3:58 PM To: linux-btrfs@vger.kernel.org Cc: Miao Xie; Philip; Omar Sandoval Subject: [PATCH 4/4] Btrfs: fix

RE: [PATCH 4/4] Btrfs: fix device replace of a missing RAID 5/6 device

2015-06-12 Thread Zhao Lei
Hi, Omar Sandoval -Original Message- From: Omar Sandoval [mailto:osan...@osandov.com] Sent: Friday, June 12, 2015 4:12 PM To: Zhao Lei Cc: linux-btrfs@vger.kernel.org; 'Miao Xie'; 'Philip' Subject: Re: [PATCH 4/4] Btrfs: fix device replace of a missing RAID 5/6 device Hi

RE: [PATCH 0/4] Btrfs: RAID 5/6 missing device replace

2015-06-10 Thread Zhao Lei
Hi, Omar Sandoval I tested this patchset with my script, but see general protection fault again. NODE: kvm with virtio disk ROOTFS: RHEL6 with btrfs-progs v4.0 KERNEL: v4.1-rc6 with 4 patchs in this patchset Maybe my test have small different with yours, but it seems is similar bug, could you

RE: [PATCH 6/9] btrfs: Fix NO_SPACE bug caused by delayed-iput

2015-07-07 Thread Zhao Lei
, Zhaolei wrote: From: Zhao Lei zhao...@cn.fujitsu.com Steps to reproduce: while true; do dd if=/dev/zero of=/btrfs_dir/file count=[fs_size * 75%] rm /btrfs_dir/file sync done And we'll see dd failed because btrfs return NO_SPACE. Reason: Normally

[PATCH 1/2] btrfs: Remove useless condition in start_log_trans()

2015-08-17 Thread Zhao Lei
and make code more readable. Reported-by: Dan Carpenter dan.carpen...@oracle.com Signed-off-by: Zhao Lei zhao...@cn.fujitsu.com --- fs/btrfs/tree-log.c | 43 +-- 1 file changed, 17 insertions(+), 26 deletions(-) diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree

[PATCH 2/2] btrfs: Remove unused arguments in tree-log.c

2015-08-17 Thread Zhao Lei
Following arguments are not used in tree-log.c: insert_one_name(): path, type wait_log_commit(): trans wait_for_writer(): trans This patch remove them. Signed-off-by: Zhao Lei zhao...@cn.fujitsu.com --- fs/btrfs/tree-log.c | 25 +++-- 1 file changed, 11 insertions(+), 14

[PATCH] btrfs-progs: Introduce warning() and error() for common use

2015-08-17 Thread Zhao Lei
-scrub.c I'll convert others these days, and new code can use these function directly. Signed-off-by: Zhao Lei zhao...@cn.fujitsu.com --- cmds-scrub.c | 171 +-- utils.c | 20 +++ utils.h | 12 + 3 files changed, 117 insertions

[PATCH] btrfs-progs: Add initialztion of rec-crossing_stripes

2015-08-21 Thread Zhao Lei
rec-crossing_stripes is not initialized in allocate place, and have possibility causing wrong report for normal tree block. Signed-off-by: Zhao Lei zhao...@cn.fujitsu.com --- cmds-check.c | 1 + 1 file changed, 1 insertion(+) diff --git a/cmds-check.c b/cmds-check.c index 4f18e45..2e6dc68

[PATCH 0/5] btrfs: scrub: setup all fields for sblock_to_check

2015-08-24 Thread Zhao Lei
, it makes other code simple(done in [PATCH 2..5]). Zhao Lei (5): btrfs: scrub: setup all fields for sblock_to_check btrfs: Reset sblock-xxx_error stats before calling scrub_recheck_block_checksum btrfs: Use scrub_checksum_data and scrub_checksum_tree_block

[PATCH 2/5] btrfs: Reset sblock-xxx_error stats before calling scrub_recheck_block_checksum

2015-08-24 Thread Zhao Lei
We should reset sblock-xxx_error stats before calling scrub_recheck_block_checksum(). Current code run correctly because all sblock are allocated by k[cz]alloc(), and the error stats are not got changed. Signed-off-by: Zhao Lei zhao...@cn.fujitsu.com --- fs/btrfs/scrub.c | 4 1 file

[PATCH 3/5] btrfs: Use scrub_checksum_data and scrub_checksum_tree_block for scrub_recheck_block_checksum

2015-08-24 Thread Zhao Lei
We can use existing scrub_checksum_data() and scrub_checksum_tree_block() for scrub_recheck_block_checksum(), instead of write duplicated code. It is base on patch of: setup all fields for sblock_to_check which make this merge possible. Signed-off-by: Zhao Lei zhao...@cn.fujitsu.com --- fs

[PATCH 1/5] btrfs: scrub: setup all fields for sblock_to_check

2015-08-24 Thread Zhao Lei
in scrub_setup_recheck_block(), for: 1: more cleanup for function arg, local variable 2: to make sblock_to_check complete, then we can use sblock_to_check without concern about some uninitialized member. Signed-off-by: Zhao Lei zhao...@cn.fujitsu.com --- fs/btrfs/scrub.c | 12 1

[PATCH 4/5] btrfs: Reduce unnecessary arguments in scrub_recheck_block

2015-08-24 Thread Zhao Lei
We don't need pass so many arguments for recheck sblock now, this patch cleans them. Signed-off-by: Zhao Lei zhao...@cn.fujitsu.com --- fs/btrfs/scrub.c | 28 1 file changed, 8 insertions(+), 20 deletions(-) diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c index

[PATCH 5/5] btrfs: Remove len argument from scrub_find_csum

2015-08-24 Thread Zhao Lei
It is useless. Signed-off-by: Zhao Lei zhao...@cn.fujitsu.com --- fs/btrfs/scrub.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c index bdf44c9..daf75ac 100644 --- a/fs/btrfs/scrub.c +++ b/fs/btrfs/scrub.c @@ -2459,8 +2459,7

RE: [PATCH] btrfs-progs: fix memory leaks in error path

2015-08-20 Thread Zhao Lei
Hi, Byongho Lee -Original Message- From: linux-btrfs-ow...@vger.kernel.org [mailto:linux-btrfs-ow...@vger.kernel.org] On Behalf Of Byongho Lee Sent: Friday, August 21, 2015 11:10 AM To: linux-btrfs@vger.kernel.org Subject: [PATCH] btrfs-progs: fix memory leaks in error path This

RE: [PATCH v2] btrfs-progs: fix memory leaks in error path

2015-08-21 Thread Zhao Lei
Reviewed-by: Zhao Lei zhao...@cn.fujitsu.com -Original Message- From: linux-btrfs-ow...@vger.kernel.org [mailto:linux-btrfs-ow...@vger.kernel.org] On Behalf Of Byongho Lee Sent: Friday, August 21, 2015 4:52 PM To: linux-btrfs@vger.kernel.org Subject: [PATCH v2] btrfs-progs: fix

RE: Btrfs: don't start the log transaction if the log tree init fails

2015-08-16 Thread Zhao Lei
Hi, Dan Carpenter Thanks for reporting this problem. Keeping code in good logic can reduce bug and make it easy to maintenance. -Original Message- From: linux-btrfs-ow...@vger.kernel.org [mailto:linux-btrfs-ow...@vger.kernel.org] On Behalf Of Dan Carpenter Sent: Friday, August 14,

[PATCH 2/2] btrfs-progs: close all fs_devices before exit in some commands

2015-08-24 Thread Zhao Lei
in other tools, for ex: cmd-check.c: the function is: cmd_check()-check_mounted()- ... - btrfs_scan_one_device() ... Signed-off-by: Zhao Lei zhao...@cn.fujitsu.com --- cmds-check.c | 1 + cmds-device.c | 4 cmds-replace.c | 2 ++ mkfs.c | 1 + 4 files changed, 8 insertions

[PATCH 1/2] btrfs-progs: Introduce btrfs_close_all_devices to close all fs_devices in fs_uuids list

2015-08-24 Thread Zhao Lei
If more than one fs_devices in fs_uuids list(as mkfs.btrfs), we need close them all before exit. This function is for above propose. Signed-off-by: Zhao Lei zhao...@cn.fujitsu.com --- volumes.c | 11 +++ volumes.h | 1 + 2 files changed, 12 insertions(+) diff --git a/volumes.c b

RE: Questions on use of NOCOW impact to subvolumes and snapshots

2015-08-19 Thread Zhao Lei
Hi, Jonathan Panozzo, -Original Message- From: linux-btrfs-ow...@vger.kernel.org [mailto:linux-btrfs-ow...@vger.kernel.org] On Behalf Of Chris Murphy Sent: Thursday, August 20, 2015 9:56 AM To: Jonathan Panozzo j...@lime-technology.com; Btrfs BTRFS linux-btrfs@vger.kernel.org

RE: [GIT PULL] Fix for btrfs/070 checksum error

2015-07-29 Thread Zhao Lei
Hi, Chris -Original Message- From: linux-btrfs-ow...@vger.kernel.org [mailto:linux-btrfs-ow...@vger.kernel.org] On Behalf Of Qu Wenruo Sent: Tuesday, July 28, 2015 3:11 PM To: Chris Mason; btrfs Subject: Re: [GIT PULL] Fix for btrfs/070 checksum error Chris Mason wrote on

[PATCH] btrfs-progs: Modify confuse error message in scrub

2015-08-05 Thread Zhao Lei
to: ERROR: scrubbing /var/ltf/tester/scratch_mnt failed for device id 5, ret=1, errno=0(Success) Signed-off-by: Zhao Lei zhao...@cn.fujitsu.com --- cmds-scrub.c | 34 +++--- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/cmds-scrub.c b/cmds-scrub.c index

[PATCH v4 2/4] btrfs: Separate scrub_blocked_if_needed() to scrub_pause_on/off()

2015-08-05 Thread Zhao Lei
It can reduce current duplicated code which is similar to scrub_blocked_if_needed() but can not call it because little different. It also used by my next patch which is in same case. Signed-off-by: Zhao Lei zhao...@cn.fujitsu.com --- fs/btrfs/scrub.c | 11 ++- 1 file changed, 10

[PATCH v4 3/4] btrfs: use scrub_pause_on/off() to reduce code in scrub_enumerate_chunks()

2015-08-05 Thread Zhao Lei
Use new intruduced scrub_pause_on/off() can make this code block clean and more readable. Signed-off-by: Zhao Lei zhao...@cn.fujitsu.com --- fs/btrfs/scrub.c | 10 +++--- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c index cbfb8c7..a882a34

[PATCH v4 4/4] btrfs: Fix data checksum error cause by replace with io-load.

2015-08-05 Thread Zhao Lei
...@cn.fujitsu.com Signed-off-by: Qu Wenruo quwen...@cn.fujitsu.com Signed-off-by: Zhao Lei zhao...@cn.fujitsu.com --- Changelog v3-v4: Patch v3 cause xfstests/061 failed in some case, because btrfs_inc_block_group_ro() include a btrfs_end_transaction() option, which will change datas in reloc_ctl

[PATCH v4 0/4] btrfs: Fix data checksum error cause by replace with io-load

2015-08-05 Thread Zhao Lei
) Changelog v1-v2: 1: Update subject to reflect the problem being fixed. 2: Update description to say reason why set read-only can fix the problem. 3: Use a helper function to avoid duplicated code block for set chunk ro. All of above are suggested by: David Sterba dste...@suse.cz Zhao Lei

[PATCH v4 1/4] btrfs: Use ref_cnt for set_block_group_ro()

2015-08-05 Thread Zhao Lei
to inc_block_group_ro/dec_block_group_ro. Signed-off-by: Zhao Lei zhao...@cn.fujitsu.com --- fs/btrfs/ctree.h | 6 +++--- fs/btrfs/extent-tree.c | 42 +- fs/btrfs/relocation.c | 14 ++ 3 files changed, 30 insertions(+), 32 deletions(-) diff --git

[PATCH 3/3] btrfs: Cleanup: Remove chunk_objectid argument from btrfs_relocate_chunk()

2015-08-05 Thread Zhao Lei
Remove chunk_objectid argument from btrfs_relocate_chunk() because it is not necessary, it can also cleanup some code in caller for prepare its value. Signed-off-by: Zhao Lei zhao...@cn.fujitsu.com --- fs/btrfs/volumes.c | 10 ++ 1 file changed, 2 insertions(+), 8 deletions(-) diff

[PATCH 2/3] btrfs: Cleanup: Remove objectid's init-value in create_reloc_inode()

2015-08-05 Thread Zhao Lei
objectid's init-value is not used in any case, remove it. Signed-off-by: Zhao Lei zhao...@cn.fujitsu.com --- 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 1659c94..4698928 100644 --- a/fs/btrfs

[PATCH 1/3] btrfs: Error handle for get_ref_objectid_v0() in relocate_block_group()

2015-08-05 Thread Zhao Lei
We need error checking code for get_ref_objectid_v0() in relocate_block_group(), to avoid unpredictable result, especially for accessing uninitialized value(when function failed) after this line. Signed-off-by: Zhao Lei zhao...@cn.fujitsu.com --- fs/btrfs/relocation.c | 4 1 file changed, 4

RE: [PATCH V2] btrfs-progs: add newline to some error messages

2015-08-06 Thread Zhao Lei
Reviewed-by: Zhao Lei zhao...@cn.fujitsu.com Thanks Zhaolei -Original Message- From: Tsutomu Itoh [mailto:t-i...@jp.fujitsu.com] Sent: Friday, August 07, 2015 8:20 AM To: linux-btrfs@vger.kernel.org Cc: Zhao Lei Subject: [PATCH V2] btrfs-progs: add newline to some error messages

RE: [PATCH 1/3] btrfs: Error handle for get_ref_objectid_v0() in relocate_block_group()

2015-08-05 Thread Zhao Lei
Hi, David Sterba -Original Message- From: David Sterba [mailto:dste...@suse.com] Sent: Thursday, August 06, 2015 1:03 AM To: Zhao Lei Cc: linux-btrfs@vger.kernel.org Subject: Re: [PATCH 1/3] btrfs: Error handle for get_ref_objectid_v0() in relocate_block_group() On Wed, Aug 05

RE: [PATCH] btrfs-progs: add newline to some error messages

2015-08-05 Thread Zhao Lei
Hi, Itoh-san -Original Message- From: linux-btrfs-ow...@vger.kernel.org [mailto:linux-btrfs-ow...@vger.kernel.org] On Behalf Of Zhao Lei Sent: Thursday, August 06, 2015 11:51 AM To: 'Tsutomu Itoh'; linux-btrfs@vger.kernel.org Subject: RE: [PATCH] btrfs-progs: add newline to some

RE: [PATCH] btrfs-progs: Modify confuse error message in scrub

2015-08-05 Thread Zhao Lei
Hi, David Sterba Thanks for review this patch. -Original Message- From: David Sterba [mailto:dste...@suse.com] Sent: Thursday, August 06, 2015 12:51 AM To: Zhao Lei Cc: linux-btrfs@vger.kernel.org Subject: Re: [PATCH] btrfs-progs: Modify confuse error message in scrub On Wed

[PATCH v2 1/2] btrfs-progs: use switch instead of a series of ifs for output errormsg

2015-08-05 Thread Zhao Lei
switch statement is more suitable for outputing currsponding message for errno. Suggested-by: David Sterba dste...@suse.com Signed-off-by: Zhao Lei zhao...@cn.fujitsu.com --- cmds-scrub.c | 33 ++--- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/cmds

[PATCH v2 2/2] btrfs-progs: Modify confuse error message in scrub

2015-08-05 Thread Zhao Lei
to: ERROR: scrubbing /var/ltf/tester/scratch_mnt failed for device id 5, ret=1, errno=0(Success) Signed-off-by: Zhao Lei zhao...@cn.fujitsu.com --- cmds-scrub.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmds-scrub.c b/cmds-scrub.c index a40eecf..2529956 100644 --- a/cmds

[PATCH] btrfs: Remove unnecessary variants in relocation.c

2015-08-06 Thread Zhao Lei
These arguments are not used in functions, remove them for cleanup and make kernel stack happy. Signed-off-by: Zhao Lei zhao...@cn.fujitsu.com --- fs/btrfs/ctree.h | 3 +-- fs/btrfs/relocation.c | 13 + fs/btrfs/transaction.c | 2 +- 3 files changed, 7 insertions(+), 11

[PATCH 1/2] btrfs: Fix wrong comment of btrfs_alloc_tree_block()

2015-08-06 Thread Zhao Lei
These wrong comment was copyed from another function(expired) from init, this patch fixed them. Signed-off-by: Zhao Lei zhao...@cn.fujitsu.com --- fs/btrfs/extent-tree.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index a436bd5..792247f

[PATCH] btrfs: abort transaction on btrfs_reloc_cow_block()

2015-08-06 Thread Zhao Lei
-by: Zhao Lei zhao...@cn.fujitsu.com --- fs/btrfs/ctree.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c index 54114b4..5f745ea 100644 --- a/fs/btrfs/ctree.c +++ b/fs/btrfs/ctree.c @@ -1159,8 +1159,10 @@ static noinline int __btrfs_cow_block

[PATCH 2/2] btrfs: Remove root argument in extent_data_ref_count()

2015-08-06 Thread Zhao Lei
Because it is never used. Signed-off-by: Zhao Lei zhao...@cn.fujitsu.com --- fs/btrfs/extent-tree.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index 792247f..5f7cbd7 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs

RE: [PATCH] btrfs-progs: add newline to some error messages

2015-08-05 Thread Zhao Lei
Hi, Itoh -Original Message- From: linux-btrfs-ow...@vger.kernel.org [mailto:linux-btrfs-ow...@vger.kernel.org] On Behalf Of Tsutomu Itoh Sent: Thursday, August 06, 2015 11:06 AM To: linux-btrfs@vger.kernel.org Subject: [PATCH] btrfs-progs: add newline to some error messages Added

[PATCH] btrfs: Add WARN_ON() for double lock in btrfs_tree_lock()

2015-08-06 Thread Zhao Lei
some. Signed-off-by: Zhao Lei zhao...@cn.fujitsu.com --- fs/btrfs/locking.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/btrfs/locking.c b/fs/btrfs/locking.c index f8229ef..d7e6baf 100644 --- a/fs/btrfs/locking.c +++ b/fs/btrfs/locking.c @@ -241,6 +241,7 @@ void

RE: resize: File too large

2015-07-22 Thread Zhao Lei
Hi, Taeha Kim -Original Message- From: linux-btrfs-ow...@vger.kernel.org [mailto:linux-btrfs-ow...@vger.kernel.org] On Behalf Of Taeha Kim Sent: Wednesday, July 22, 2015 1:20 PM To: linux-btrfs@vger.kernel.org Subject: resize: File too large Hello, I met a problem when resize

RE: stack trace (free_fs_root) with either fallocate + mv-across-subvolumes, or mount-wth-compress + dd

2015-07-22 Thread Zhao Lei
Hi, Sasà Vita Thanks for reporting! -Original Message- From: linux-btrfs-ow...@vger.kernel.org [mailto:linux-btrfs-ow...@vger.kernel.org] On Behalf Of Sasà Vita Sent: Wednesday, July 22, 2015 1:52 PM To: linux-btrfs@vger.kernel.org Subject: stack trace (free_fs_root) with either

RE: [BUG] kernel BUG at fs/btrfs/scrub.c:1956!, when scrubbing freshly converted ext4

2015-07-22 Thread Zhao Lei
Hi, Chris Murphy Thanks for report this bug. -Original Message- From: linux-btrfs-ow...@vger.kernel.org [mailto:linux-btrfs-ow...@vger.kernel.org] On Behalf Of Chris Murphy Sent: Thursday, July 09, 2015 11:16 AM To: Btrfs BTRFS Subject: [BUG] kernel BUG at fs/btrfs/scrub.c:1956!,

RE: [PATCH] btrfs: Add raid56 support for updating num_tolerated_disk_barrier_failures in btrfs_balance()

2015-07-17 Thread Zhao Lei
in btrfs_balance() nice clean up thanks. but... more below. On 07/16/2015 08:15 PM, Zhaolei wrote: From: Zhao Lei zhao...@cn.fujitsu.com Code for updating fs_info-num_tolerated_disk_barrier_failures in btrfs_balance() lacks raid56 support. Reason: Above code was wroten in 2012

RE: [PATCH] btrfs: Add raid56 support for updating num_tolerated_disk_barrier_failures in btrfs_balance()

2015-07-20 Thread Zhao Lei
Hi, Anand Jain -Original Message- From: linux-btrfs-ow...@vger.kernel.org [mailto:linux-btrfs-ow...@vger.kernel.org] On Behalf Of Zhao Lei Sent: Friday, July 17, 2015 5:39 PM To: 'Anand Jain'; linux-btrfs@vger.kernel.org Subject: RE: [PATCH] btrfs: Add raid56 support for updating

[PATCH] btrfs-progs: unified error handle for print_replace_status

2015-08-25 Thread Zhao Lei
small logic cleanup. Signed-off-by: Zhao Lei zhao...@cn.fujitsu.com --- cmds-replace.c | 16 +++- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/cmds-replace.c b/cmds-replace.c index ce91787..134addf 100644 --- a/cmds-replace.c +++ b/cmds-replace.c @@ -405,7 +405,6

RE: [PATCH] btrfs: Remove code for no-cow in scrub/replace

2015-10-26 Thread Zhao Lei
Hi, Filipe Manana > -Original Message- > From: Filipe Manana [mailto:fdman...@gmail.com] > Sent: Friday, October 23, 2015 11:17 PM > To: Jeff Mahoney <je...@suse.com> > Cc: Zhao Lei <zhao...@cn.fujitsu.com>; linux-btrfs@vger.kernel.org > Subject: Re: [PATCH]

RE: [PATCH] btrfs: Remove code for no-cow in scrub/replace

2015-10-26 Thread Zhao Lei
Hi, Jeff Mahoney Thanks for review! > -Original Message- > From: Jeff Mahoney [mailto:je...@suse.com] > Sent: Friday, October 23, 2015 11:11 PM > To: Zhao Lei <zhao...@cn.fujitsu.com>; linux-btrfs@vger.kernel.org > Subject: Re: [PATCH] btrfs: Remove code for no

[PATCH v2 0/5] btrfs-progs: Add all missing close_ctree and btrfs_close_all_devices

2015-10-26 Thread Zhao Lei
This patch add all missing close_ctree and btrfs_close_all_devices to several tools in btrfs progs, to avoid memory leak. Changelog v1->v2: Move btrfs_close_all_devices() from cmd-XXX into btrfs.c to make code simple, and avoid similar problem in cmd-XXX in future. Zhao Lei (5): btrfs-pr

[PATCH v2 1/5] btrfs-progs: btrfs: Add missing btrfs_close_all_devices for btrfs command

2015-10-26 Thread Zhao Lei
Adding a btrfs_close_all_devices() after command callback in btrfs.c can force-close all opened device before program exit, to avoid memory leak in all btrfs sub-command. Suggested-by: David Sterba <dste...@suse.cz> Signed-off-by: Zhao Lei <zhao...@cn.fujitsu.com> --- btrfs.c | 9

[PATCH v2 5/5] btrfs-progs: use system's default path for math.h

2015-10-26 Thread Zhao Lei
Line of #include "math.h" in extent-tree.c using quotas is history reason, (we have cuseom math.h in source before) Now it is better to use "<>" instead of quotas for this header file. Signed-off-by: Zhao Lei <zhao...@cn.fujitsu.com> --- extent-tree.c | 2 +- 1

[PATCH v2 4/5] btrfs-progs: Add missing close_ctree to btrfs-select-super.c

2015-10-26 Thread Zhao Lei
Add missing close_ctree() to btrfs-select-super.c to avoid memory leak. Signed-off-by: Zhao Lei <zhao...@cn.fujitsu.com> --- btrfs-select-super.c | 1 + 1 file changed, 1 insertion(+) diff --git a/btrfs-select-super.c b/btrfs-select-super.c index bd44978..df74153 100644 --- a/btrfs-

[PATCH v2 2/5] btrfs-progs: Remove all btrfs_close_all_devices in sub-command

2015-10-26 Thread Zhao Lei
Since we have btrfs_close_all_devices() in btrfs's main entrance, it is not necessary to call btrfs_close_all_devices() separately in each sub-command. Signed-off-by: Zhao Lei <zhao...@cn.fujitsu.com> --- cmds-check.c | 1 - cmds-device.c | 3 --- cmds-replace.c | 2 -- 3 files chan

[PATCH v2 3/5] btrfs-progs: Add all missing btrfs_close_all_devices to standalone tools

2015-10-26 Thread Zhao Lei
This patch add all missing btrfs_close_all_devices() to standalone tools in btrfs progs, to avoid memory leak. Signed-off-by: Zhao Lei <zhao...@cn.fujitsu.com> --- btrfs-calc-size.c| 1 + btrfs-debug-tree.c | 5 - btrfs-find-root.c| 1 + btrfs-map-logical.c | 1 + btrfs-

[PATCH 4/6] btrfs-progs: Fix uninitialized key.type for btrfs_find_free_objectid

2015-10-29 Thread Zhao Lei
To avoid using uninitialized value in btrfs_search_slot(). Signed-off-by: Zhao Lei <zhao...@cn.fujitsu.com> --- inode-map.c | 1 + 1 file changed, 1 insertion(+) diff --git a/inode-map.c b/inode-map.c index 1321bfb..346952b 100644 --- a/inode-map.c +++ b/inode-map.c @@ -44,6 +44,7

[PATCH 3/6] btrfs-progs: free fslabel for btrfs-convert

2015-10-29 Thread Zhao Lei
fslabel need to be freed before exit. Signed-off-by: Zhao Lei <zhao...@cn.fujitsu.com> --- btrfs-convert.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/btrfs-convert.c b/btrfs-convert.c index 5b9171e..1693d03 100644 --- a/btrfs-convert.c +++ b/btrfs-convert.c @@ -3027,6 +3027,9

[PATCH 2/6] btrfs-progs: Fix negative eb's ref_cnt in btrfs-calc-size

2015-10-29 Thread Zhao Lei
t_size() is only used to save node data, it don't hold ref_cnt for each eb in. Using btrfs_free_path() to free path will reduce these eb again, and cause many problems, as negative ref_cnt or invalid memory access. Signed-off-by: Zhao Lei <zhao...@cn.fujitsu.com> --- btrfs-cal

[PATCH 1/6] btrfs-progs: fix floating point exception for btrfs-calc-size

2015-10-29 Thread Zhao Lei
exception This patch add a condition check for above case. Signed-off-by: Zhao Lei <zhao...@cn.fujitsu.com> --- btrfs-calc-size.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/btrfs-calc-size.c b/btrfs-calc-size.c index b756693..17d44ae 100644 --- a/btrfs-calc-size.c

[PATCH 5/6] btrfs-progs: free comparer_set in cmd_qgroup_show

2015-10-29 Thread Zhao Lei
comparer_set, which was allocated by malloc(), should be free before function return. Signed-off-by: Zhao Lei <zhao...@cn.fujitsu.com> --- cmds-qgroup.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmds-qgroup.c b/cmds-qgroup.c index a64b716..f069d32 100644 ---

[PATCH 6/6] btrfs-progs: Avoid use pointer in handle_options

2015-10-29 Thread Zhao Lei
for condition in handle_options() to make line short. Signed-off-by: Zhao Lei <zhao...@cn.fujitsu.com> --- btrfs.c | 30 -- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/btrfs.c b/btrfs.c index 9416a29..f881c18 100644 --- a/btrfs.c +++ b/b

[PATCH] btrfs: Remove code for no-cow in scrub/replace

2015-10-23 Thread Zhao Lei
with 10 mount options include nodatacow. Signed-off-by: Zhao Lei <zhao...@cn.fujitsu.com> --- fs/btrfs/ctree.h | 1 - fs/btrfs/scrub.c | 669 --- 2 files changed, 670 deletions(-) diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h index 9

[PATCH] btrfs: Continue replace when set_block_ro failed

2015-11-13 Thread Zhao Lei
ailed because no space in device. Fix: When set_block_ro failed for metadata chunk, it is not a problem because scrub_lock forbids commit_trancaction. Let replace continue in this case is no problem. Tested by above script, and xfstests/011, plus 100 times xfstests/070. Signed-off-by: Zhao Lei <zhao...@

RE: [PATCH] btrfs: Continue replace when set_block_ro failed

2015-11-16 Thread Zhao Lei
Hi, Filipe Manana > -Original Message- > From: Filipe Manana [mailto:fdman...@gmail.com] > Sent: Monday, November 16, 2015 6:57 PM > To: Zhao Lei <zhao...@cn.fujitsu.com> > Cc: linux-btrfs@vger.kernel.org > Subject: Re: [PATCH] btrfs: Continue replace when set_blo

RE: [PATCH] btrfs: Continue replace when set_block_ro failed

2015-11-16 Thread Zhao Lei
Hi, Filipe Manana Thanks for review. > -Original Message- > From: Filipe Manana [mailto:fdman...@gmail.com] > Sent: Friday, November 13, 2015 8:02 PM > To: Zhao Lei <zhao...@cn.fujitsu.com> > Cc: linux-btrfs@vger.kernel.org > Subject: Re: [PATCH] btrfs: Continue r

RE: [PATCH] btrfs: Continue replace when set_block_ro failed

2015-11-16 Thread Zhao Lei
Hi, Filipe Manana > -Original Message- > From: linux-btrfs-ow...@vger.kernel.org > [mailto:linux-btrfs-ow...@vger.kernel.org] On Behalf Of Filipe Manana > Sent: Monday, November 16, 2015 6:27 PM > To: Zhao Lei <zhao...@cn.fujitsu.com> > Cc: linux-btrfs@vger.

[PATCH v2] btrfs: Continue replace when set_block_ro failed

2015-11-17 Thread Zhao Lei
Let replace continue in this case is no problem. Tested by above script, and xfstests/011, plus 100 times xfstests/070. Changelog v1->v2: 1: Add detail comments in source and commit-message. 2: Add dmesg detail into commit-message. 3: Limit return value of -ENOSPC to be passed. All suggested

RE: [PATCH 1/3] btrfs-progs: cmds-device: use warning/error for error message

2015-11-10 Thread Zhao Lei
Hi, Anand Jain > -Original Message- > From: Anand Jain [mailto:anand.j...@oracle.com] > Sent: Monday, November 09, 2015 6:34 PM > To: Zhao Lei <zhao...@cn.fujitsu.com> > Cc: linux-btrfs@vger.kernel.org; dste...@suse.cz > Subject: Re: [PATCH 1/3] btrfs-progs: cmds-d

[GIT PULL] Fujitsu for 4.4

2015-11-09 Thread Zhao Lei
and I have queued xfstests(btrfs/generic with all mountopt) for this branch, (need about 4~5 days), and no error found until now(1 days). -- Zhao Lei (9): btrfs: scrub: set error stats when tree block spanning stripes btrfs: scrub: setup all fields for sblock_to_check btrfs: Reset sblock->xx

[PATCH 3/3] btrfs-progs: Remove noused path argument in _cmd_device_usage

2015-11-09 Thread Zhao Lei
Argument of char *path in _cmd_device_usage() is not necessary, remove it. Signed-off-by: Zhao Lei <zhao...@cn.fujitsu.com> --- cmds-device.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmds-device.c b/cmds-device.c index 739405b..190bed6 100644 --- a/cmds-de

[PATCH 1/3] btrfs-progs: cmds-device: use warning/error for error message

2015-11-09 Thread Zhao Lei
Switch to common warning()/error() for cmds-device.c. Signed-off-by: Zhao Lei <zhao...@cn.fujitsu.com> --- cmds-device.c | 57 +++-- 1 file changed, 23 insertions(+), 34 deletions(-) diff --git a/cmds-device.c b/cmds-device.c index 2

[PATCH 2/3] btrfs-progs: cleanup cmd_device_usage

2015-11-09 Thread Zhao Lei
1: Remove more_than_one variant, use iterator's value instead 2: Remove "out" mark, use break instead. Signed-off-by: Zhao Lei <zhao...@cn.fujitsu.com> --- cmds-device.c | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/cmds-device.c b/cmds-device

[PATCH] btrfs-progs: Check periodic.timer_fd's value before use

2015-11-09 Thread Zhao Lei
periodic.timer_fd's value is 0 on inititlize-failed case, if no value-checking before read(), the code will run as read(STDIN). This patch fixed above case. Signed-off-by: Zhao Lei <zhao...@cn.fujitsu.com> --- task-utils.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/task-uti

[PATCH 2/2] btrfs-progs: Rename variables in btrfs_add_to_fsid

2015-11-02 Thread Zhao Lei
_count -> device_total_bytes To make code more readable. Signed-off-by: Zhao Lei <zhao...@cn.fujitsu.com> --- utils.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/utils.c b/utils.c index b7752df..999af43 100644 --- a/utils.c +++ b/utils.c @@ -724,7 +724,

[PATCH 1/2] btrfs-progs: mkfs: Round device size down to sectorsize

2015-11-02 Thread Zhao Lei
Wenruo <quwen...@cn.fujitsu.com> Signed-off-by: Zhao Lei <zhao...@cn.fujitsu.com> --- utils.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/utils.c b/utils.c index d17291a..b7752df 100644 --- a/utils.c +++ b/utils.c @@ -736,6 +736,8 @@ int btrfs_add_to_fsid(struct btrfs_trans_h

[PATCH 2/2] btrfs-progs: mkfs: remove unused code of format uuid string

2015-11-03 Thread Zhao Lei
Variant named dev_uuid and uuid_unparse() for set its value are not used, remove it. Signed-off-by: Zhao Lei <zhao...@cn.fujitsu.com> --- mkfs.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/mkfs.c b/mkfs.c index 75fc086..d5da1fb 100644 --- a/mkfs.c +++ b/mkfs.c @@ -1176,9 +

[PATCH 1/2] btrfs-progs: mkfs: output device list in sorted order

2015-11-03 Thread Zhao Lei
Signed-off-by: Zhao Lei <zhao...@cn.fujitsu.com> --- mkfs.c | 12 +++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/mkfs.c b/mkfs.c index 14e7eb4..75fc086 100644 --- a/mkfs.c +++ b/mkfs.c @@ -42,6 +42,7 @@ #include "volumes.h" #include "transaction.

RE: [PATCH 5/6] btrfs-progs: free comparer_set in cmd_qgroup_show

2015-11-01 Thread Zhao Lei
Hi, David Sterba > -Original Message- > From: David Sterba [mailto:dste...@suse.cz] > Sent: Friday, October 30, 2015 9:36 PM > To: Zhao Lei <zhao...@cn.fujitsu.com> > Cc: linux-btrfs@vger.kernel.org > Subject: Re: [PATCH 5/6] btrfs-progs: free comparer_set in cmd

[PATCH v4 1/3] btrfs: Fix lost-data-profile caused by auto removing bg

2015-10-08 Thread Zhao Lei
v Suggested-by: Jeff Mahoney <je...@suse.com> Changelog v1->v2: 1: Put code of checking block_group->list into semaphore of space_info->groups_sem. Noticed-by: Filipe Manana <fdman...@gmail.com> Reviewed-by: Filipe Manana <fdman...@suse.com> Signed-off-by: Z

[PATCH v4 2/3] btrfs: Fix lost-data-profile caused by balance bg

2015-10-08 Thread Zhao Lei
>v2: 1: Update patch description of "Fix" field 2: Use BTRFS_BLOCK_GROUP_DATA for btrfs_force_chunk_alloc instead of 1 3: Only reserve chunk when doing balance on data chunk. All suggested-by: Filipe Manana <fdman...@gmail.com> Reviewed-by: Filipe Manana <fdman...@suse.com

[PATCH v4 3/3] btrfs: Use fs_info directly in btrfs_delete_unused_bgs

2015-10-08 Thread Zhao Lei
No need to use root->fs_info in btrfs_delete_unused_bgs(), use fs_info directly instead. Signed-off-by: Zhao Lei <zhao...@cn.fujitsu.com> --- fs/btrfs/extent-tree.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tre

RE: [PATCH v6 0/4] VFS: In-kernel copy system call

2015-10-20 Thread Zhao Lei
Hi, Anna Schumaker This patchset compile ok in x86 and x86_64 target, But failed in arm when compiling btrfs dir, and output following error message: :1304:2: warning: #warning syscall copy_file_range not implemented [-Wcpp] Reproduce: merge commands: cd /mnt/big1/linux git fetch -q --all

[PATCH] btrfs-progs: Add all missing close_ctree and btrfs_close_all_devices

2015-10-11 Thread Zhao Lei
This patch add all missing close_ctree and btrfs_close_all_devices to several tools in btrfs progs, to avoid memory leak. Signed-off-by: Zhao Lei <zhao...@cn.fujitsu.com> --- btrfs-calc-size.c| 1 + btrfs-debug-tree.c | 5 - btrfs-find-root.c| 1 + btrfs-map-logical.c

[PATCH 01/11] btrfs-progs: subvolume: use btrfs_open_dir for btrfs subvolume command

2015-10-12 Thread Zhao Lei
/tmp/123' ERROR: cannot create subvolume - Inappropriate ioctl for device # After patch: # btrfs subvolume create /mnt/tmp/123 ERROR: not btrfs filesystem: /mnt/tmp # Signed-off-by: Zhao Lei <zhao...@cn.fujitsu.com> --- cmds-subvolume.

[PATCH 07/11] btrfs-progs: qgroup: use btrfs_open_dir for btrfs qgroup command

2015-10-12 Thread Zhao Lei
# ./btrfs qgroup show /mnt/tmp1 ERROR: not a btrfs filesystem: /mnt/tmp1 # ./btrfs qgroup limit 1G 1/5 /mnt/tmp1 ERROR: not a btrfs filesystem: /mnt/tmp1 Signed-off-by: Zhao Lei <zhao...@cn.fujitsu.com> --- cmds-qgroup.c | 24 1 file changed, 8 insertions(

[PATCH 09/11] btrfs-progs: use btrfs_open_dir in open_path_or_dev_mnt

2015-10-12 Thread Zhao Lei
ts /mnt/tmp1 ERROR: not a btrfs filesystem: /mnt/tmp1 # ./btrfs replace start /dev/vdd /dev/vde /mnt/tmp1 ERROR: not a btrfs filesystem: /mnt/tmp1 Signed-off-by: Zhao Lei <zhao...@cn.fujitsu.com> --- cmds-device.c | 13 ++--- cmds-replace.c | 13 ++--

  1   2   3   >