[PATCH v3.1 09/10] btrfs-progs: tests: add testcase for undelete-subvol

2018-05-07 Thread Lu Fengqi
The testcase checks the functionality of "btrfs rescue undelete-subvol", including recovering an intact subvolume, and handling correctly incomplete subvolume. Signed-off-by: Lu Fengqi --- V3.1: remove unnecessary check_prereq btrfs-image V3: rename testcase to

Re: [PATCH v2 1/2] btrfs-progs: qgroup: swap the argument in the caller of update_qgroup_relation

2018-05-07 Thread Qu Wenruo
On 2018年05月08日 13:48, Lu Fengqi wrote: > The QGROUP_RELATION item is very special, it always exists in pairs > (objectid and offset exchange). Its objectid and offset are the ids of a > pair of parent and child qgroups, respectively. The larger one is > parent and the smaller one is child. After

[PATCH v2 1/2] btrfs-progs: qgroup: swap the argument in the caller of update_qgroup_relation

2018-05-07 Thread Lu Fengqi
The QGROUP_RELATION item is very special, it always exists in pairs (objectid and offset exchange). Its objectid and offset are the ids of a pair of parent and child qgroups, respectively. The larger one is parent and the smaller one is child. After the following commit, the order of the

[PATCH 2/2] btrfs-progs: tests: check btrfs qgroup parent-child relation output

2018-05-07 Thread Lu Fengqi
Since commit aaf2dac5ef37 ("btrfs-progs: qgroup: split update_qgroup to reduce arguments") cause qgroup show to output the wrong qgroup parent-child relationship, in addition to fixing the problem, a test case is needed to prevent the similar problem in the future. Signed-off-by: Lu Fengqi

Re: [PATCH 0/5] Fix delalloc inodes leaking on btrfs unmount

2018-05-07 Thread Nikolay Borisov
On 8.05.2018 01:58, David Sterba wrote: > On Fri, Apr 27, 2018 at 12:21:49PM +0300, Nikolay Borisov wrote: >> After investigating crashes on generic/176 it turned that the culprit in fact >> is the random failure induced by generic/019. As it happens, if on unmount >> the >> filesystem is in

[PATCH] btrfs: send, improve rmdir performance for large directory

2018-05-07 Thread robbieko
From: Robbie Ko At present, we check if the directory can be deleted. We need to check whether all the files under this directory have been processed every time we finished processing an entry under that directory. Example: 2,000,000 files in 1 directory. Parent snapshot:

Re: [PATCH v4 00/18] btrfs-progs: lowmem check: avoid extents overwrite

2018-05-07 Thread Su Yue
On 05/08/2018 10:06 AM, Qu Wenruo wrote: On 2018年05月08日 10:09, Su Yue wrote: On 05/08/2018 02:17 AM, David Sterba wrote: On Thu, Feb 08, 2018 at 11:27:19AM +0800, Su Yue wrote: This patchset can be fetched from my github: https://github.com/Damenly/btrfs-progs/tree/lowmem based on

Re: [PATCH v4 00/18] btrfs-progs: lowmem check: avoid extents overwrite

2018-05-07 Thread Qu Wenruo
On 2018年05月08日 10:09, Su Yue wrote: > > > On 05/08/2018 02:17 AM, David Sterba wrote: >> On Thu, Feb 08, 2018 at 11:27:19AM +0800, Su Yue wrote: >>> This patchset can be fetched from my github: >>> https://github.com/Damenly/btrfs-progs/tree/lowmem >>> based on unmerged patchset whose cover:

Re: [PATCH v4 00/18] btrfs-progs: lowmem check: avoid extents overwrite

2018-05-07 Thread Su Yue
On 05/08/2018 02:17 AM, David Sterba wrote: On Thu, Feb 08, 2018 at 11:27:19AM +0800, Su Yue wrote: This patchset can be fetched from my github: https://github.com/Damenly/btrfs-progs/tree/lowmem based on unmerged patchset whose cover: [PATCH 0/3] btrfs-progs: Split original mode check

Re: Problem with current->journal_info for BTRFS, Null pointer dereference in start_transaction

2018-05-07 Thread Liu Bo
On Mon, May 7, 2018 at 2:49 PM, robbieko wrote: > Hi, > > When send process requires memory allocation, shrinker may be triggered due > to insufficient memory. > Then evict_inode gets called when inode is dropped, and this function may > need to start transaction. >

Re: [PATCH] btrfs-progs: qgroup: swap the argument in the caller of update_qgroup_relation

2018-05-07 Thread Lu Fengqi
On Mon, May 07, 2018 at 07:19:32PM +0800, Qu Wenruo wrote: > > >On 2018年05月07日 16:50, Lu Fengqi wrote: >> The QGROUP_RELATION item is very special, it always exists in pairs >> (objectid and offset exchange). Its objectid and offset are the ids of a >> pair of parent and child qgroups,

Btrfs installation advices

2018-05-07 Thread faurepierr
Hi, I'm curious about btrfs, and maybe considering it for my new laptop installation (a Lenovo T470). I was going to install my usual lvm+ext4+full disk encryption setup, but thought I should maybe give a try to btrfs. Is it possible to meet all these criteria? - operating system: debian

Re: [PATCH 0/5] Fix delalloc inodes leaking on btrfs unmount

2018-05-07 Thread David Sterba
On Fri, Apr 27, 2018 at 12:21:49PM +0300, Nikolay Borisov wrote: > After investigating crashes on generic/176 it turned that the culprit in fact > is the random failure induced by generic/019. As it happens, if on unmount > the > filesystem is in BTRFS_FS_STATE_ERROR then

Re: [PATCH] btrfs: remove redundant btrfs_balance_control::fs_info

2018-05-07 Thread Anand Jain
On 05/07/2018 11:44 PM, David Sterba wrote: The fs_info is always available from the context so we don't need to store it in the structure. Signed-off-by: David Sterba Reviewed-by: Anand Jain -- To unsubscribe from this list: send the line

Re: [PATCH 0/4] btrfs check --check-data-csum enhancement for

2018-05-07 Thread David Sterba
On Tue, Feb 27, 2018 at 05:12:55PM +0800, Qu Wenruo wrote: > Log-writes tool from Josef exposed btrfs data corruption. > > Although still digging, at least enhance --check-data-csum option so > that log-replay --check can stop exactly at the point where btrfs data > get corrupted, instead of

Re: [PATCH v4 00/18] btrfs-progs: lowmem check: avoid extents overwrite

2018-05-07 Thread David Sterba
On Thu, Feb 08, 2018 at 11:27:19AM +0800, Su Yue wrote: > This patchset can be fetched from my github: > https://github.com/Damenly/btrfs-progs/tree/lowmem > based on unmerged patchset whose cover: > [PATCH 0/3] btrfs-progs: Split original mode check to its own > Author: Qu Wenruo

Re: [PATCH 0/3] Lowmem fsck repair to fix filetype mismatch

2018-05-07 Thread David Sterba
On Wed, Jan 17, 2018 at 01:17:07PM +0800, Qu Wenruo wrote: > Sebastian reported a filesystem corruption where DIR_INDEX has wrong > filetype against INODE_ITEM. > > Lowmem mode normally handles such problem by checking DIR_INDEX, > DIR_ITEM and INODE_REF/INODE_ITEM to determine the correct file

Re: metadata_ratio mount option?

2018-05-07 Thread Chris Mason
On 7 May 2018, at 12:16, Martin Svec wrote: Hello Chris, Dne 7.5.2018 v 16:49 Chris Mason napsal(a): On 7 May 2018, at 7:40, Martin Svec wrote: Hi, According to man btrfs [1], I assume that metadata_ratio=1 mount option should force allocation of one metadata chunk after every allocated

Re: metadata_ratio mount option?

2018-05-07 Thread Martin Svec
Hello Chris, Dne 7.5.2018 v 16:49 Chris Mason napsal(a): > On 7 May 2018, at 7:40, Martin Svec wrote: > >> Hi, >> >> According to man btrfs [1], I assume that metadata_ratio=1 mount option >> should >> force allocation of one metadata chunk after every allocated data chunk. >> However, >> when

[PATCH] btrfs: remove redundant btrfs_balance_control::fs_info

2018-05-07 Thread David Sterba
The fs_info is always available from the context so we don't need to store it in the structure. Signed-off-by: David Sterba --- fs/btrfs/ioctl.c | 3 +-- fs/btrfs/volumes.c | 7 +++ fs/btrfs/volumes.h | 5 ++--- 3 files changed, 6 insertions(+), 9 deletions(-) diff

Re: [PATCH] btrfs: qgroup: Allow trace_btrfs_qgroup_account_extent() to record its transid

2018-05-07 Thread David Sterba
On Thu, May 03, 2018 at 09:59:02AM +0800, Qu Wenruo wrote: > When debugging quota rescan race, some times btrfs rescan could account > some old (committed) leaf and then re-account newly committed leaf > in next generation. > > This race needs extra transid to locate, so add @transid for >

Re: [PATCH] btrfs: send: fix spelling mistake: "send_in_progres" -> "send_in_progress"

2018-05-07 Thread David Sterba
On Fri, May 04, 2018 at 12:11:12PM +0100, Colin King wrote: > From: Colin Ian King > > Trivial fix to spelling mistake of function name in btrfs_err message > > Signed-off-by: Colin Ian King Applied, thanks. -- To unsubscribe from this list:

Re: [PATCH] btrfs: Remove devid parameter from btrfs_rmap_block

2018-05-07 Thread David Sterba
On Fri, May 04, 2018 at 10:53:05AM +0300, Nikolay Borisov wrote: > This function is used in only one place and devid argument is always > passed 0. So just remove it, similarly to how it was removed in the > userspace code. > > Signed-off-by: Nikolay Borisov Reviewed-by:

Re: metadata_ratio mount option?

2018-05-07 Thread Chris Mason
On 7 May 2018, at 7:40, Martin Svec wrote: Hi, According to man btrfs [1], I assume that metadata_ratio=1 mount option should force allocation of one metadata chunk after every allocated data chunk. However, when I set this option and start filling btrfs with "dd if=/dev/zero

Re: [PATCH v2 04/10] btrfs-progs: undelete-subvol: introduce is_subvol_intact

2018-05-07 Thread Qu Wenruo
On 2018年05月07日 19:40, David Sterba wrote: > On Mon, May 07, 2018 at 10:20:57AM +0800, Qu Wenruo wrote: > +++ b/undelete-subvol.c > @@ -0,0 +1,53 @@ > +/* > + * Copyright (C) 2018 Fujitsu.  All rights reserved. IIRC David will remove all such copy right line. Is

Re: [PATCH v2 04/10] btrfs-progs: undelete-subvol: introduce is_subvol_intact

2018-05-07 Thread David Sterba
On Mon, May 07, 2018 at 10:20:57AM +0800, Qu Wenruo wrote: > >>> +++ b/undelete-subvol.c > >>> @@ -0,0 +1,53 @@ > >>> +/* > >>> + * Copyright (C) 2018 Fujitsu.  All rights reserved. > >> > >> IIRC David will remove all such copy right line. > >> Is there some principle about this, David? > > > >

metadata_ratio mount option?

2018-05-07 Thread Martin Svec
Hi, According to man btrfs [1], I assume that metadata_ratio=1 mount option should force allocation of one metadata chunk after every allocated data chunk. However, when I set this option and start filling btrfs with "dd if=/dev/zero of=dummyfile.dat", only data chunks are allocated but no

Re: [PATCH] btrfs-progs: qgroup: swap the argument in the caller of update_qgroup_relation

2018-05-07 Thread Qu Wenruo
On 2018年05月07日 16:50, Lu Fengqi wrote: > The QGROUP_RELATION item is very special, it always exists in pairs > (objectid and offset exchange). Its objectid and offset are the ids of a > pair of parent and child qgroups, respectively. The larger one is > parent and the smaller one is child. After

Re: PF1-1 2018 首次TB

2018-05-07 Thread Cao jin
Sorry for the noise:( On 05/07/2018 05:23 PM, Cao jin wrote: > Dear all > > 首先道歉一下,2018过去这么久了还没有TB过,导致我们现在相当富裕:p > So,年度TB首秀开始报名啦,这次的选择有午餐和KTV,如果KTV足够凑个包厢,下午我们就去嗨一下:) > > 报名地址: > http://www.stdp.css.fujitsu.com:8080/nnnce/schedules/view/360 > -- Sincerely, Cao jin -- To unsubscribe from

PF1-1 2018 首次TB

2018-05-07 Thread Cao jin
Dear all 首先道歉一下,2018过去这么久了还没有TB过,导致我们现在相当富裕:p So,年度TB首秀开始报名啦,这次的选择有午餐和KTV,如果KTV足够凑个包厢,下午我们就去嗨一下:) 报名地址: http://www.stdp.css.fujitsu.com:8080/nnnce/schedules/view/360 -- Sincerely, Cao jin -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to

[PATCH] btrfs-progs: qgroup: swap the argument in the caller of update_qgroup_relation

2018-05-07 Thread Lu Fengqi
The QGROUP_RELATION item is very special, it always exists in pairs (objectid and offset exchange). Its objectid and offset are the ids of a pair of parent and child qgroups, respectively. The larger one is parent and the smaller one is child. After the following commit, the order of the

[PATCH v2 0/2] btrfs fiemap related BUG fix.

2018-05-07 Thread robbieko
From: Robbie Ko This patchset intends to fix btrfs fiemap related bug. The fiemap has the following problems: 1) fiemap: pass correct bytenr when fm_extent_count is zero When user space wants to get the number of file extents, set fm_extent_count to 0 to run fiemap and

[PATCH v2 1/2] Btrfs: fiemap: pass correct bytenr when fm_extent_count is zero

2018-05-07 Thread robbieko
From: Robbie Ko [BUG] fm_mapped_extents is not correct when fm_extent_count is 0 Like: # mount /dev/vdb5 /mnt/btrfs # dd if=/dev/zero bs=16K count=4 oflag=dsync of=/mnt/btrfs/file # xfs_io -c "fiemap -v" /mnt/btrfs/file /mnt/btrfs/file: EXT: FILE-OFFSET

[PATCH v2 2/2] Btrfs: fix fiemap extent SHARED flag error with range clone.

2018-05-07 Thread robbieko
From: Robbie Ko [BUG] Range clone can cause fiemap to return error result. Like: # mount /dev/vdb5 /mnt/btrfs # dd if=/dev/zero bs=16K count=2 oflag=dsync of=/mnt/btrfs/file # btrfs-debugfs -f file (276 0): ram 16384 disk 2171609088 disk_size 16384 (276 16384): ram

[PATCH 2/2] btrfs-progs: misc-tests: Add test case for dump-tree on heavily corrupted leaf

2018-05-07 Thread Qu Wenruo
Signed-off-by: Qu Wenruo --- .../032-bad-item-ptr/bad_item_ptr.raw.xz | Bin 0 -> 21964 bytes tests/misc-tests/032-bad-item-ptr/test.sh | 17 + 2 files changed, 17 insertions(+) create mode 100644 tests/misc-tests/032-bad-item-ptr/bad_item_ptr.raw.xz

[PATCH 1/2] btrfs-progs: print-tree: Avoid segfault for heavily corrupted item pointers

2018-05-07 Thread Qu Wenruo
Normally corrupted leaf should be caught by csum check, but sometimes corrupted item pointers (out of leaf range) can still pass csum check. In fact, our fsck/005 test case image has such corrupted item pointer and btrfs check can surprisingly fix it. Anyway, make print-tree to skip such item and

Problem with current->journal_info for BTRFS, Null pointer dereference in start_transaction

2018-05-07 Thread robbieko
Hi, When send process requires memory allocation, shrinker may be triggered due to insufficient memory. Then evict_inode gets called when inode is dropped, and this function may need to start transaction. However, the journal_info is already points to BTRFS_SEND_TRANS_STUB, it passed the if