[PATCH v3 1/7] btrfs-progs: Fix wrong address accessing by subthread in btrfs-convert

2015-07-27 Thread Zhaolei
From: Zhao Lei zhao...@cn.fujitsu.com btrfs-convert sometimes show 'Assertion failed' in converting a nearly blank file system, as: create btrfs filesystem: blocksize: 4096 nodesize: 16384 features: extref, skinny-metadata (default) creating btrfs metadata.

[PATCH v3 0/7] btrfs-progs: Fix wrong address accessing by subthread in btrfs-convert

2015-07-27 Thread Zhaolei
From: Zhao Lei zhao...@cn.fujitsu.com It is v3 patchset of: Fix wrong address accessing by subthread in btrfs-convert. Changelog v2-v3: 1: Add $TOP path prefix to btrfs-convert command in: [PATCH v2 7/7] btrfs-progs: Introduce a misc test for thread conflict in btrfs-convert To

[PATCH v3 4/7] btrfs-progs: resst info-periodic.timer_fd's value after free

2015-07-27 Thread Zhaolei
From: Zhao Lei zhao...@cn.fujitsu.com task_period_stop() is used to close a timer explicitly, to avoid the timer handle closed again by task_stop(), we should reset its value after close. Also add value-reset for info-id for safe. Signed-off-by: Zhao Lei zhao...@cn.fujitsu.com --- task-utils.c

[PATCH] btrfs-progs-tests: Add -o loop to fsck-tests/012-leaf-corruption for loop device

2015-07-27 Thread Zhaolei
From: Zhao Lei zhao...@cn.fujitsu.com To avoid following mount error in test: mount: /root/btrfs/progs/tests/fsck-tests/012-leaf-corruption/test.img is not a block device (maybe try `-o loop'?) Signed-off-by: Zhao Lei zhao...@cn.fujitsu.com --- tests/fsck-tests/012-leaf-corruption/test.sh |

[PATCH v3 2/7] btrfs-progs: Move close timer handle code to line after sub process exit

2015-07-27 Thread Zhaolei
From: Zhao Lei zhao...@cn.fujitsu.com The timer handle have possibility in using by sub thread, better to close it after sub process exit. Signed-off-by: Zhao Lei zhao...@cn.fujitsu.com --- task-utils.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/task-utils.c

[PATCH v3 6/7] btrfs-progs: Move code to create loop device to common

2015-07-27 Thread Zhaolei
From: Zhao Lei zhao...@cn.fujitsu.com This code block is common used, move it to common function will make code clean. Signed-off-by: Zhao Lei zhao...@cn.fujitsu.com --- tests/common | 16 tests/fsck-tests/013-extent-tree-rebuild/test.sh | 11

[PATCH v3 5/7] btrfs-progs: Set info-periodic.timer_fd to 0 in init-fail

2015-07-27 Thread Zhaolei
From: Zhao Lei zhao...@cn.fujitsu.com In current code, (info-periodic.timer_fd == 0) means it is not valid, as: if (info-periodic.timer_fd) { close(info-periodic.timer_fd); ... We need set its value from -1 to 0 in create-fail case, to make code like above works. Signed-off-by:

[PATCH v3 3/7] btrfs-progs: Remove cleanup-timer code for btrfs-convert

2015-07-27 Thread Zhaolei
From: Zhao Lei zhao...@cn.fujitsu.com No need to close timer handle afain in subthread-close-callback, it is closed by task_stop() automatically. This patch also add a fflush() to make log output on time. Signed-off-by: Zhao Lei zhao...@cn.fujitsu.com --- btrfs-convert.c | 4 +--- 1 file

[PATCH v3 7/7] btrfs-progs: Introduce a misc test for thread conflict in btrfs-convert

2015-07-27 Thread Zhaolei
From: Zhao Lei zhao...@cn.fujitsu.com Current code of btrfs-convert have a bug of thread conflict, which caused invalid memory accessing between threads, and make program panic. This patch add a test item for above bug, as: # ./misc-tests.sh [TEST] 001-btrfstune-features [TEST]

Re: [PATCH] btrfs-progs-tests: Add -o loop to fsck-tests/012-leaf-corruption for loop device

2015-07-27 Thread David Sterba
On Mon, Jul 27, 2015 at 09:01:50PM +0800, Zhaolei wrote: From: Zhao Lei zhao...@cn.fujitsu.com To avoid following mount error in test: mount: /root/btrfs/progs/tests/fsck-tests/012-leaf-corruption/test.img is not a block device (maybe try `-o loop'?) Signed-off-by: Zhao Lei

[PATCH] btrfs-progs: Show detail error message when write sb failed in write_dev_supers()

2015-07-27 Thread Zhaolei
From: Zhao Lei zhao...@cn.fujitsu.com fsck-tests.sh failed and show following message in my node: # ./fsck-tests.sh [TEST] 001-bad-file-extent-bytenr disk-io.c:1444: write_dev_supers: Assertion `ret != BTRFS_SUPER_INFO_SIZE` failed.

Re: [PATCH] Btrfs: btrfs_submit_bio_hook: Use btrfs_wq_endio_type values instead of integer constants

2015-07-27 Thread David Sterba
On Mon, Jul 27, 2015 at 03:26:43PM +0530, Chandan Rajendra wrote: btrfs_submit_bio_hook() uses integer constants instead of values from enum btrfs_wq_endio_type. Fix this. Signed-off-by: Chandan Rajendra chan...@linux.vnet.ibm.com Reviewed-by: David Sterba dste...@suse.com -- To unsubscribe

[PATCH 1/2] btrfs-progs-tests: Introduce init_env() to initialize common env variant

2015-07-27 Thread Zhaolei
From: Zhao Lei zhao...@cn.fujitsu.com For example, $TEST_DIR is common used in severial tests, and have duplicated code for initialize. These duplicated code not only benifits harddisk vendor, but have inconsistent details, as: convert-tests.sh: lack of mkdir

[PATCH 2/2] btrfs-progs-tests: Fix mount fail of 013-extent-tree-rebuild

2015-07-27 Thread Zhaolei
From: Zhao Lei zhao...@cn.fujitsu.com When using loop device for test, fsck-tests/013-extent-tree-rebuild failed with following error message: # ./fsck-tests.sh ... [TEST] 013-extent-tree-rebuild failed: mount /data/btrfsprogs/tests/test.img /data/btrfsprogs/tests/mnt test failed

Re: [PATCH 4/4] btrfs: convert: Avoid allocating metadata extent crossing stripe boundary

2015-07-27 Thread David Sterba
On Sat, Jul 25, 2015 at 09:18:54AM +0800, Qu Wenruo wrote: This caught my attention and looking at possible values of num_bytes, this can crash: 1291 for (last_byte = 0; last_byte first_free; last_byte += sectorsize) { 1292 ret = custom_alloc_extent(root,

Re: [PATCH] Btrfs: fix order by which delayed references are run

2015-07-27 Thread Chris Mason
On Mon, Jul 27, 2015 at 05:22:28PM +0800, Qu Wenruo wrote: Filipe Manana wrote on 2015/07/27 09:26 +0100: On Mon, Jul 27, 2015 at 7:53 AM, Qu Wenruo quwen...@cn.fujitsu.com wrote: Hi Filipe, Hi Qu, Sorry for the late reply after it is already merged, but I'm a little concerned

Re: [PATCH v3 0/7] btrfs-progs: Fix wrong address accessing by subthread in btrfs-convert

2015-07-27 Thread David Sterba
On Mon, Jul 27, 2015 at 08:24:25PM +0800, Zhaolei wrote: From: Zhao Lei zhao...@cn.fujitsu.com Zhao Lei (7): btrfs-progs: Fix wrong address accessing by subthread in btrfs-convert btrfs-progs: Move close timer handle code to line after sub process exit btrfs-progs: Remove

Re: [PATCH v2 10/10] btrfs-progs: Allow open_ctree use backup tree root or search it automatically if primary tree root is corrupted.

2015-07-27 Thread David Sterba
On Mon, Jan 19, 2015 at 02:45:12PM +0800, Qu Wenruo wrote: Allow open_ctree to try its best to open tree root on damaged file system. With this patch, open_ctree will follow the below priority to read tree root, providing better chance to open damaged btrfs fs. 1) Using root bytenr in SB to

Re: [PATCH 0/7] btrfs-progs: qgroup related enhance.

2015-07-27 Thread David Sterba
On Tue, Mar 24, 2015 at 08:36:33AM +0800, Qu Wenruo wrote: All of the above merged. btrfs-progs: Schedule quota rescan if qgroup assign caused inconsistence. The rescan can be a long running operation and touches a lot of metadata, so I'd rather avoid starting the rescan

Re: systemd : Timed out waiting for defice dev-disk-by…

2015-07-27 Thread Philip Seeger
On 07/27/2015 07:20 AM, Duncan wrote: Philip Seeger posted on Sun, 26 Jul 2015 22:39:04 +0200 as excerpted: Hi, 50% of the time when booting, the system go in safe mode because my 12x 4TB RAID10 btrfs is taking too long to mount from fstab. This won't help, but I've seen this exact

Re: [PATCH 2/3] btrfs: add replace missing and replace RAID 5/6 to profile configs

2015-07-27 Thread Hugo Mills
On Tue, Jul 28, 2015 at 12:22:56AM +0200, Brendan Hide wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 2015/07/24 07:50 PM, Omar Sandoval wrote: On Fri, Jul 24, 2015 at 02:09:46PM +0200, David Sterba wrote: On Thu, Jul 23, 2015 at 01:51:50PM -0700, Omar Sandoval wrote: +

Re: [PATCH 2/3] btrfs: add replace missing and replace RAID 5/6 to profile configs

2015-07-27 Thread Brendan Hide
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 2015/07/24 07:50 PM, Omar Sandoval wrote: On Fri, Jul 24, 2015 at 02:09:46PM +0200, David Sterba wrote: On Thu, Jul 23, 2015 at 01:51:50PM -0700, Omar Sandoval wrote: + # We can't do replace with these profiles because they +

Re: [PATCH 0/7] btrfs-progs: qgroup related enhance.

2015-07-27 Thread Qu Wenruo
David Sterba wrote on 2015/07/27 16:35 +0200: On Tue, Mar 24, 2015 at 08:36:33AM +0800, Qu Wenruo wrote: All of the above merged. btrfs-progs: Schedule quota rescan if qgroup assign caused inconsistence. The rescan can be a long running operation and touches a lot of metadata,

Re: [PATCH v2 10/10] btrfs-progs: Allow open_ctree use backup tree root or search it automatically if primary tree root is corrupted.

2015-07-27 Thread Qu Wenruo
David Sterba wrote on 2015/07/27 17:04 +0200: On Mon, Jan 19, 2015 at 02:45:12PM +0800, Qu Wenruo wrote: Allow open_ctree to try its best to open tree root on damaged file system. With this patch, open_ctree will follow the below priority to read tree root, providing better chance to open

[PATCH] Btrfs: btrfs_submit_bio_hook: Use btrfs_wq_endio_type values instead of integer constants

2015-07-27 Thread Chandan Rajendra
btrfs_submit_bio_hook() uses integer constants instead of values from enum btrfs_wq_endio_type. Fix this. Signed-off-by: Chandan Rajendra chan...@linux.vnet.ibm.com --- fs/btrfs/inode.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c

[PATCH] btrfs-progs-tests: Avoid outputting useless warning in ./fsck-tests.sh

2015-07-27 Thread Zhaolei
From: Zhao Lei zhao...@cn.fujitsu.com 002-bad-transid outout 'transid verify failed' message in screen which is just a warning in btrfs-image in normal condition of this test. This patch move above warning into $RESULTS, to: 1: Avoid trouble screen output 2: Let user known detail if other error

[PATCH v2 6/7] btrfs-progs: Move code to create loop device to common

2015-07-27 Thread Zhaolei
From: Zhao Lei zhao...@cn.fujitsu.com This code block is common used, move it to common function will make code clean. Signed-off-by: Zhao Lei zhao...@cn.fujitsu.com --- tests/common | 16 tests/fsck-tests/013-extent-tree-rebuild/test.sh | 11

[PATCH v2 1/7] btrfs-progs: Fix wrong address accessing by subthread in btrfs-convert

2015-07-27 Thread Zhaolei
From: Zhao Lei zhao...@cn.fujitsu.com btrfs-convert sometimes show 'Assertion failed' in converting a nearly blank file system, as: create btrfs filesystem: blocksize: 4096 nodesize: 16384 features: extref, skinny-metadata (default) creating btrfs metadata.

[PATCH v2 7/7] btrfs-progs: Introduce a misc test for thread conflict in btrfs-convert

2015-07-27 Thread Zhaolei
From: Zhao Lei zhao...@cn.fujitsu.com Current code of btrfs-convert have a bug of thread conflict, which caused invalid memory accessing between threads, and make program panic. This patch add a test item for above bug, as: # ./misc-tests.sh [TEST] 001-btrfstune-features [TEST]

[PATCH v2 5/7] btrfs-progs: Set info-periodic.timer_fd to 0 in init-fail

2015-07-27 Thread Zhaolei
From: Zhao Lei zhao...@cn.fujitsu.com In current code, (info-periodic.timer_fd == 0) means it is not valid, as: if (info-periodic.timer_fd) { close(info-periodic.timer_fd); ... We need set its value from -1 to 0 in create-fail case, to make code like above works. Signed-off-by:

[PATCH] btrfs-progs-tests: Add '-o loop' to mount command line in convert-tests.sh

2015-07-27 Thread Zhaolei
From: Zhao Lei zhao...@cn.fujitsu.com To fix following bug: # ./convert-tests.sh [TEST] ext2 4k nodesize, btrfs defaults failed: mount /root/btrfsprogs/tests/test.img /root/btrfsprogs/tests/mnt # tail convert-tests-results.txt ... ### mount /root/btrfsprogs/tests/test.img

Re: [PATCH] Btrfs: fix order by which delayed references are run

2015-07-27 Thread Qu Wenruo
Hi Filipe, Sorry for the late reply after it is already merged, but I'm a little concerned about the extra loop to find the first inc delayed ref. It may take some extra time when there are a lot of delayed refs. What about allowing deleting the extent item at dec delayed ref time and then

[PATCH v2 3/7] btrfs-progs: Remove cleanup-timer code for btrfs-convert

2015-07-27 Thread Zhaolei
From: Zhao Lei zhao...@cn.fujitsu.com No need to close timer handle afain in subthread-close-callback, it is closed by task_stop() automatically. This patch also add a fflush() to make log output on time. Signed-off-by: Zhao Lei zhao...@cn.fujitsu.com --- btrfs-convert.c | 4 +--- 1 file

[PATCH v2 4/7] btrfs-progs: resst info-periodic.timer_fd's value after free

2015-07-27 Thread Zhaolei
From: Zhao Lei zhao...@cn.fujitsu.com task_period_stop() is used to close a timer explicitly, to avoid the timer handle closed again by task_stop(), we should reset its value after close. Also add value-reset for info-id for safe. Signed-off-by: Zhao Lei zhao...@cn.fujitsu.com --- task-utils.c

[PATCH v2 0/7] btrfs-progs: Fix wrong address accessing by subthread in btrfs-convert

2015-07-27 Thread Zhaolei
From: Zhao Lei zhao...@cn.fujitsu.com It is v2 patchset of: Fix wrong address accessing by subthread in btrfs-convert. Changelog: 1: Move bug test script from patch description into a single script in test/misc-tests, suggested-by: David Sterba dste...@suse.com 2: Move code for creating

Re: [PATCH] Btrfs: fix order by which delayed references are run

2015-07-27 Thread Filipe Manana
On Mon, Jul 27, 2015 at 7:53 AM, Qu Wenruo quwen...@cn.fujitsu.com wrote: Hi Filipe, Hi Qu, Sorry for the late reply after it is already merged, but I'm a little concerned about the extra loop to find the first inc delayed ref. It may take some extra time when there are a lot of delayed

[PATCH] Btrfs: fix warning in backref walking

2015-07-27 Thread Liu Bo
When we do backref walking, we search firstly in queued delayed refs and then the on-disk backrefs, but we parse differently for shared references, for delayed refs we also add 'ref-root' while for on-disk backrefs we don't, this can prevent us from merging refs indexed by the same bytenr and

Re: [PATCH] Btrfs: fix warning in backref walking

2015-07-27 Thread Filipe David Manana
On Mon, Jul 27, 2015 at 9:15 AM, Liu Bo bo.li@oracle.com wrote: When we do backref walking, we search firstly in queued delayed refs and then the on-disk backrefs, but we parse differently for shared references, for delayed refs we also add 'ref-root' while for on-disk backrefs we don't,

Re: [PATCH] Btrfs: fix order by which delayed references are run

2015-07-27 Thread Qu Wenruo
Filipe Manana wrote on 2015/07/27 09:26 +0100: On Mon, Jul 27, 2015 at 7:53 AM, Qu Wenruo quwen...@cn.fujitsu.com wrote: Hi Filipe, Hi Qu, Sorry for the late reply after it is already merged, but I'm a little concerned about the extra loop to find the first inc delayed ref. It may take