Re: [PATCH v2 1/3] btrfs: tree-checker: Fix false panic for sanity test

2017-11-07 Thread Nikolay Borisov
On 8.11.2017 02:54, Qu Wenruo wrote: > [BUG] > If we run btrfs with CONFIG_BTRFS_FS_RUN_SANITY_TESTS=y, it will > instantly cause kernel panic like: > > -- > ... > assertion failed: 0, file: fs/btrfs/disk-io.c, line: 3853 > ... > Call Trace: > btrfs_mark_buffer_dirty+0x187/0x1f0 [btrfs] >

Re: Problem with file system

2017-11-07 Thread Chris Murphy
On Tue, Nov 7, 2017 at 6:02 AM, Austin S. Hemmelgarn wrote: > * Optional automatic correction of errors detected during normal usage. > Right now, you have to run a scrub to correct errors. Such a design makes > sense with MD and LVM, where you don't know which copy is

[PATCH] fstests: btrfs: add 'zstd' to compress property filter

2017-11-07 Thread Misono, Tomohiro
This fixes the false failure of btrfs/059 when running with the mount option '-o compress=zstd'. Signed-off-by: Tomohiro Misono --- common/filter.btrfs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/filter.btrfs b/common/filter.btrfs

[PATCH v2 1/3] btrfs: tree-checker: Fix false panic for sanity test

2017-11-07 Thread Qu Wenruo
[BUG] If we run btrfs with CONFIG_BTRFS_FS_RUN_SANITY_TESTS=y, it will instantly cause kernel panic like: -- ... assertion failed: 0, file: fs/btrfs/disk-io.c, line: 3853 ... Call Trace: btrfs_mark_buffer_dirty+0x187/0x1f0 [btrfs] setup_items_for_insert+0x385/0x650 [btrfs]

[PATCH v2 2/3] btrfs: tree-checker: Add checker for dir item

2017-11-07 Thread Qu Wenruo
Add checker for dir item, for key types DIR_ITEM, DIR_INDEX and XATTR_ITEM. This checker does comprehensive check for: 1) dir_item header and its data size Against item boundary and maximum name/xattr length. This part is mostly the same as old verify_dir_item(). 2) dir_type Against

[PATCH v2 3/3] btrfs: Cleanup existing name_len checks

2017-11-07 Thread Qu Wenruo
Since tree-checker has verified leaf when reading from disk, we don't need the existing verify_dir_item() or btrfs_is_name_len_valid(). Signed-off-by: Qu Wenruo --- Unlike checks in btrfs_mark_buffer_dirty(), the existing checks all happen in read routine, so there is no need to

Re: [PATCH 1/2] btrfs: tree-checker: Add checker for variable length item

2017-11-07 Thread Qu Wenruo
On 2017年11月08日 08:13, Qu Wenruo wrote: > > > On 2017年11月08日 04:50, David Sterba wrote: >> On Wed, Nov 01, 2017 at 08:22:12PM +0800, Qu Wenruo wrote: >>> For the following types, we have items with variable length: >>> (With BTRFS_ prefix and _KEY suffix snipped) >>> >>> DIR_ITEM >>> DIR_INDEX

Re: [PATCH 2/2] btrfs: Cleanup existing name_len checks

2017-11-07 Thread Qu Wenruo
On 2017年11月08日 04:56, David Sterba wrote: > On Wed, Nov 01, 2017 at 08:22:13PM +0800, Qu Wenruo wrote: >> Since tree-checker has verified leaf when reading from disk, we don't >> need the existing checker. >> >> This cleanup reverts the following commits: >> fbc326159a01 ("btrfs: Verify dir_item

Re: [PATCH 1/2] btrfs: tree-checker: Add checker for variable length item

2017-11-07 Thread Qu Wenruo
On 2017年11月08日 04:50, David Sterba wrote: > On Wed, Nov 01, 2017 at 08:22:12PM +0800, Qu Wenruo wrote: >> For the following types, we have items with variable length: >> (With BTRFS_ prefix and _KEY suffix snipped) >> >> DIR_ITEM >> DIR_INDEX >> XATTR_ITEM >> INODE_REF >> INODE_EXTREF >>

Re: [PATCH] btrfs: tree-checker: Fix false panic for sanity test

2017-11-07 Thread Qu Wenruo
On 2017年11月08日 05:12, David Sterba wrote: > On Mon, Nov 06, 2017 at 01:47:17PM +0800, Qu Wenruo wrote: >> [BUG] >> If we run btrfs with CONFIG_BTRFS_FS_RUN_SANITY_TESTS=y, it will >> instantly cause kernel panic like: > > Which patch causes that? To be specific, the file extent item checker.

Re: Error During Balancing - No Space Left on Device

2017-11-07 Thread Ben Hooper
For the archives… I replaced the 2x2TB drives with 8TB drives and now I see the correct amount of space and the balancing process is working without error so far. # btrfs replace start 2 /dev/sdaa /data (replace old 2TB /dev/sdk with new 8TB drive /dev/sdaa) # btrfs replace start 3 /dev/sdab

Re: [PATCH] btrfs: Reduce scope of delayed_rsv->lock in may_commit_trans

2017-11-07 Thread David Sterba
On Tue, Nov 07, 2017 at 10:42:26PM +0200, Nikolay Borisov wrote: > > > On 7.11.2017 22:18, David Sterba wrote: > > On Tue, Nov 07, 2017 at 11:22:54AM +0200, Nikolay Borisov wrote: > >> After commit ('btrfs: change how we decide to commit transactions during > > > > 996478ca9c460886ac1 > >

Re: [PATCH] btrfs: tree-checker: Fix false panic for sanity test

2017-11-07 Thread David Sterba
On Mon, Nov 06, 2017 at 01:47:17PM +0800, Qu Wenruo wrote: > [BUG] > If we run btrfs with CONFIG_BTRFS_FS_RUN_SANITY_TESTS=y, it will > instantly cause kernel panic like: Which patch causes that? The selftests used to catch various errors when the original dir_item verification patches were

Re: [PATCH 2/2] btrfs: Cleanup existing name_len checks

2017-11-07 Thread David Sterba
On Wed, Nov 01, 2017 at 08:22:13PM +0800, Qu Wenruo wrote: > Since tree-checker has verified leaf when reading from disk, we don't > need the existing checker. > > This cleanup reverts the following commits: > fbc326159a01 ("btrfs: Verify dir_item in iterate_object_props") > 64c7b01446f4 ("btrfs:

Re: [PATCH 1/2] btrfs: tree-checker: Add checker for variable length item

2017-11-07 Thread David Sterba
On Wed, Nov 01, 2017 at 08:22:12PM +0800, Qu Wenruo wrote: > For the following types, we have items with variable length: > (With BTRFS_ prefix and _KEY suffix snipped) > > DIR_ITEM > DIR_INDEX > XATTR_ITEM > INODE_REF > INODE_EXTREF > ROOT_REF > ROOT_BACKREF > > They all use @name_len to

Re: [PATCH] btrfs: Reduce scope of delayed_rsv->lock in may_commit_trans

2017-11-07 Thread Nikolay Borisov
On 7.11.2017 22:18, David Sterba wrote: > On Tue, Nov 07, 2017 at 11:22:54AM +0200, Nikolay Borisov wrote: >> After commit ('btrfs: change how we decide to commit transactions during > > 996478ca9c460886ac1 That commit is still not pulled by linus so is this id stable? > >> flushing') there

Re: [PATCH] btrfs: Reduce scope of delayed_rsv->lock in may_commit_trans

2017-11-07 Thread David Sterba
On Tue, Nov 07, 2017 at 11:22:54AM +0200, Nikolay Borisov wrote: > After commit ('btrfs: change how we decide to commit transactions during 996478ca9c460886ac1 > flushing') there is no need to hold the delayed_rsv during the > percpu_counter_compare call since we get the byte's snapshot earlier.

Re: [PATCH 00/10] Cleanup unnecessary get_extent parameters

2017-11-07 Thread David Sterba
On Mon, Nov 06, 2017 at 11:26:54PM +0200, Nikolay Borisov wrote: > > > On 6.11.2017 21:30, David Sterba wrote: > > There are several functions that take a generic get_extent parameter, but > > not > > all of them use it to distinguish between btree_get_exnent (for metadata) > > and > >

☑ linuo126:参展JEC是一个复合材料及新材料企业走向国际化的标志和途径☛2018第53届世界JEC复合材料展览及会议(上U2/L50-mE)

2017-11-07 Thread 润滑脂
linuo126    JEC world Composites Show & Conferences 2018 2018第53届JEC世界复合材料展览及会议    —— 参展JEC是一个复合材料及新材料企业走向国际化的标志和途径    【中文名称】 2018第53届世界JEC复合材料展览及会议(法国巴黎) 【英文名称】 The 53th JEC Composites Show & Conferences 2018 in Paris France (JEC world 2018)    【展会时间】 2018年03月06-08日 (正月十九至二十一) 【展会地点】

Re: [PATCH] btrfs: switch uuid tree semaphore to mutex

2017-11-07 Thread David Sterba
On Tue, Nov 07, 2017 at 01:58:12PM +, Filipe Manana wrote: > On Mon, Nov 6, 2017 at 6:24 PM, David Sterba wrote: > > @@ -3696,9 +3696,9 @@ void close_ctree(struct btrfs_fs_info *fs_info) > > btrfs_qgroup_wait_for_completion(fs_info, false); > > > > /* wait

[PATCH v2 2/2] Btrfs: fix reported number of inode blocks after buffered append writes

2017-11-07 Thread fdmanana
From: Filipe Manana The patch from commit a7e3b975a0f9 ("Btrfs: fix reported number of inode blocks") introduced a regression where if we do a buffered write starting at position equal to or greater than the file's size and then stat(2) the file before writeback is triggered,

[PATCH v2 1/2] Btrfs: move definition of the function btrfs_find_new_delalloc_bytes

2017-11-07 Thread fdmanana
From: Filipe Manana Move the definition of the function btrfs_find_new_delalloc_bytes() closer to the function btrfs_dirty_pages(), because in a future commit it will be used exclusively by btrfs_dirty_pages(). This just moves the function's definition, with no functional

[PATCH v4] Btrfs: add support for fallocate's zero range operation

2017-11-07 Thread fdmanana
From: Filipe Manana This implements support the zero range operation of fallocate. For now at least it's as simple as possible while reusing most of the existing fallocate and hole punching infrastructure. Signed-off-by: Filipe Manana --- V2: Removed

Re: [PATCH] btrfs: switch uuid tree semaphore to mutex

2017-11-07 Thread Filipe Manana
On Mon, Nov 6, 2017 at 6:24 PM, David Sterba wrote: > The uuid_tree_rescan_sem is used as a mutex (initialized with value 1 > and with at most one active user), no reason to obscure that as a > semaphore. > > Signed-off-by: David Sterba > --- >

Re: Problem with file system

2017-11-07 Thread Austin S. Hemmelgarn
On 2017-11-07 02:01, Dave wrote: On Sat, Nov 4, 2017 at 1:25 PM, Chris Murphy wrote: On Sat, Nov 4, 2017 at 1:26 AM, Dave wrote: On Mon, Oct 30, 2017 at 5:37 PM, Chris Murphy wrote: That is not a general purpose

Re: Should cp default to reflink?

2017-11-07 Thread Dmitrii Tcvetkov
On Mon, 6 Nov 2017 15:37:21 -0700 Chris Murphy wrote: > Seems to me any request to duplicate should be optimized by default > with an auto reflink when possible, and require an explicit option to > inhibit. "cp --reflink=auto" by default might create unexpected behaviour of slower balance on a

Re: Should cp default to reflink?

2017-11-07 Thread Austin S. Hemmelgarn
On 2017-11-06 17:37, Chris Murphy wrote: I'm doing copies from one subvolume to another, through a mounted top level (id5) at /mnt/int. This copies the whole file conventionally (no shared extents) $ sudo cp /mnt/int/home/chris/Downloads/Fedora-Server-dvd-x86_64-27-1.6.iso

Re: [PATCH 1/4] Btrfs: introduce device flags

2017-11-07 Thread Anand Jain
On 11/02/2017 08:54 AM, Liu Bo wrote: Here we have defined two flags, - Fautly - In_sync Currently only In_sync is in use, it only matters when device serves as part of a raid profile. The flag In_sync is decided when mounting a btrfs and opening a device, by default every device is set with

[PATCH] btrfs: Reduce scope of delayed_rsv->lock in may_commit_trans

2017-11-07 Thread Nikolay Borisov
After commit ('btrfs: change how we decide to commit transactions during flushing') there is no need to hold the delayed_rsv during the percpu_counter_compare call since we get the byte's snapshot earlier. So hold the lock only while reading delayed_rsv Signed-off-by: Nikolay Borisov

Re: feedback on three different scrub methods

2017-11-07 Thread Qu Wenruo
On 2017年11月07日 16:45, Nikolay Borisov wrote: > > > On 7.11.2017 02:54, Qu Wenruo wrote: >> >> >> On 2017年11月07日 04:17, Chris Murphy wrote: >>> I just did scrubs on five different volumes using all three scrub >>> methods. There were no errors found, so the test leaves uncertain what >>> the

Re: feedback on three different scrub methods

2017-11-07 Thread Nikolay Borisov
On 7.11.2017 02:54, Qu Wenruo wrote: > > > On 2017年11月07日 04:17, Chris Murphy wrote: >> I just did scrubs on five different volumes using all three scrub >> methods. There were no errors found, so the test leaves uncertain what >> the error handling differences are between the three scrubs.

[PATCH v2 11/12] btrfs-progs: test/mkfs: Add test case for -R quota option

2017-11-07 Thread Qu Wenruo
Only test if btrfs check (which will check qgroup by default) and kernel mount success. Comprehensive qgroup test cases still belongs to fstests. Signed-off-by: Qu Wenruo --- tests/mkfs-tests/001-basic-profiles/test.sh | 10 ++ 1 file changed, 10 insertions(+) diff

[PATCH v2 07/12] btrfs-progs: mkfs: Introduce function to setup quota root and rescan

2017-11-07 Thread Qu Wenruo
Introduce a new function, setup_quota_root(), which will create quota root, and do an offline rescan to ensure all quota accounting numbers are correct. Signed-off-by: Qu Wenruo --- mkfs/main.c | 86 + 1 file changed, 86

[PATCH v2 05/12] btrfs-progs: ctree: Introduce function to create an empty tree

2017-11-07 Thread Qu Wenruo
Introduce a new function, btrfs_create_tree(), to create an empty tree. Currently, there is only one caller to create new tree, namely data reloc tree in mkfs. However it's copying fs tree to create a new root. This copy fs tree method is not a good idea if we only need an empty tree. So here

[PATCH v2 10/12] btrfs-progs: mkfs: Introduce quota runtime feature

2017-11-07 Thread Qu Wenruo
Introduce quota runtime feature for mkfs. The result fs will has quota enabled, with consistent qgroup accounting. This is quite handy to test quota with fstests, which doesn't support to call ioctl for btrfs at mount time. Signed-off-by: Qu Wenruo ---

[PATCH v2 04/12] btrfs-progs: qgroup-verify: Allow repair_qgroups function to do silent repair

2017-11-07 Thread Qu Wenruo
Allow repair_qgroups() to do silent repair, so it can acts as offline qgroup rescan. This provides the basis for later mkfs quota support. Signed-off-by: Qu Wenruo --- cmds-check.c| 2 +- qgroup-verify.c | 19 +++ qgroup-verify.h | 2 +- 3 files changed, 13

[PATCH v2 01/12] btrfs-progs: qgroup-verify: Also repair qgroup status version

2017-11-07 Thread Qu Wenruo
Current kernel only supports qgroup version 1. Make qgroup-verify to follow this standard. Signed-off-by: Qu Wenruo --- ctree.h | 1 + qgroup-verify.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/ctree.h b/ctree.h index 22806599a744..506b76766579 100644 ---

[PATCH v2 06/12] btrfs-progs: mkfs: Introduce function to insert qgroup info and limit items

2017-11-07 Thread Qu Wenruo
Introduce a new function, insert_qgroup_items(), to insert qgroup info item and qgroup limit item for later mkfs qgroup support. Signed-off-by: Qu Wenruo --- mkfs/main.c | 34 ++ 1 file changed, 34 insertions(+) diff --git a/mkfs/main.c

[PATCH 1/3] btrfs-progs: mkfs: Introduce quota runtime feature

2017-11-07 Thread Qu Wenruo
Introduce quota runtime feature for mkfs. The result fs will has quota enabled, with consistent qgroup accounting. This is quite handy to test quota with fstests, which doesn't support to call ioctl for btrfs at mount time. Signed-off-by: Qu Wenruo ---

[PATCH 3/3] btrfs-progs: test/mkfs: Add test case for --rootdir and -R quota

2017-11-07 Thread Qu Wenruo
Nothing interesting, since such combination can be handled easily by qgroup-verify. Signed-off-by: Qu Wenruo --- tests/mkfs-tests/010-rootdir-and-quota/test.sh | 51 ++ 1 file changed, 51 insertions(+) create mode 100755

[PATCH v2 03/12] btrfs-progs: qgroup-verify: Move qgroup classification out of report_qgroups

2017-11-07 Thread Qu Wenruo
The original qgroup-verify integrates qgroup classification into report_qgroups(). This behavior makes silent qgroup repair (or offline rescan) impossible. To repair qgroup, we must call report_qgroups() to trigger bad qgroup classification, which will output error message. This patch moves bad

[PATCH 2/3] btrfs-progs: test/mkfs: Add test case for -R quota option

2017-11-07 Thread Qu Wenruo
Only test if btrfs check (which will check qgroup by default) and kernel mount success. Comprehensive qgroup test cases still belongs to fstests. Signed-off-by: Qu Wenruo --- tests/mkfs-tests/001-basic-profiles/test.sh | 10 ++ 1 file changed, 10 insertions(+) diff

[PATCH v2 12/12] btrfs-progs: test/mkfs: Add test case for --rootdir and -R quota

2017-11-07 Thread Qu Wenruo
Nothing interesting, since such combination can be handled easily by qgroup-verify. Signed-off-by: Qu Wenruo --- tests/mkfs-tests/010-rootdir-and-quota/test.sh | 51 ++ 1 file changed, 51 insertions(+) create mode 100755

[PATCH v2 09/12] btrfs-progs: mkfs: Introduce --runtime-features option

2017-11-07 Thread Qu Wenruo
Just like -O|--features, introduce -R|--runtime-features to enable features like qgroup, and maybe space cache later. Currently only mkfs is supported, mainly for test purpose. Convert is not supported yet. Signed-off-by: Qu Wenruo --- Documentation/mkfs.btrfs.asciidoc | 16

[PATCH v2 08/12] btrfs-progs: fsfeatures: Introduce a new set of features, runtime_features

2017-11-07 Thread Qu Wenruo
Introduce runtime_features for fsfeatures.[ch], and related functions: btrfs_list_all_runtime_features() btrfs_parse_runtime_features() btrfs_process_runtime_features() btrfs_parse_runtime_features_to_string() And rename one function to avoid confusion: btrfs_parse_features_to_string() ->

[PATCH v2 00/12] mkfs: Quota support through -R|--runtime quota

2017-11-07 Thread Qu Wenruo
Can be fetched from github: https://github.com/adam900710/btrfs-progs/tree/mkfs_qgroup This patchset adds quota support, which means the result fs will have quota enabled by default, and its accounting is already consistent, no manually rescan or quota enable is needed. The overall design of

[PATCH v2 02/12] btrfs-progs: qgroup-verify: Use fs_info->readonly to check if we should repair qgroups

2017-11-07 Thread Qu Wenruo
In fact qgroup-verify is just kind of offline qgroup rescan, and later mkfs qgroup support will reuse it. So qgroup-verify doesn't really need to rely the global variable @repair to check if it should repair qgroups. Instead check fs_info->readonly to do the repair. Signed-off-by: Qu Wenruo

Re: [PATCH 2/4] Btrfs: fix data corruption in raid6

2017-11-07 Thread Anand Jain
On 11/02/2017 08:54 AM, Liu Bo wrote: With raid6 profile, btrfs can end up with data corruption by the following steps. Say we have a 5 disks that are set up with raid6 profile, 1) mount this btrfs 2) one disk gets pulled out 3) write something to btrfs and sync 4) another disk gets pulled