Re: [PATCH 3/5] btrfs: raid56: Use correct stolen pages to calculate P/Q

2017-03-15 Thread Liu Bo
On Fri, Feb 03, 2017 at 04:20:21PM +0800, Qu Wenruo wrote: > In the following situation, scrub will calculate wrong parity to > overwrite correct one: > > RAID5 full stripe: > > Before > | Dev 1 | Dev 2 | Dev 3 | > | Data stripe 1 | Data stripe 2 | Parity Stripe | > --

[PATCH 2/2] btrfs-progs: convert: Make btrfs_reserved_ranges const

2017-03-15 Thread Qu Wenruo
Since btrfs_reserved_ranges array is just used to store btrfs reserved ranges, no one will nor should modify them at run time, make them static and const will be better. This also eliminates the use of immediate number 3. Signed-off-by: Qu Wenruo --- convert/main.c | 16 c

[PATCH 1/2] btrfs-progs: kerncompat: Fix re-definition of __bitwise

2017-03-15 Thread Qu Wenruo
In latest linux api headers, __bitwise is already defined in /usr/include/linux/types.h. So kerncompat.h will re-define __bitwise, and cause gcc warning. Fix it by checking if __bitwise is already define. Signed-off-by: Qu Wenruo --- The patch is based on devel branch with the following head: c

Re: [PATCH 2/2] btrfs: replace hardcoded value with SEQ_NONE macro

2017-03-15 Thread Qu Wenruo
At 03/15/2017 10:38 PM, David Sterba wrote: On Mon, Mar 13, 2017 at 02:32:04PM -0600, ednadol...@gmail.com wrote: From: Edmund Nadolski Define the SEQ_NONE macro to replace (u64)-1 in places where said value triggers a special-case ref search behavior. index 9c41fba..20915a6 100644 --- a/

Re: [PATCH] btrfs: remove unused qgroup members from btrfs_trans_handle

2017-03-15 Thread Qu Wenruo
At 03/15/2017 11:17 PM, David Sterba wrote: The members have been effectively unused since "Btrfs: rework qgroup accounting" (fcebe4562dec83b3), there's no substitute for assert_qgroups_uptodate so it's removed as well. Signed-off-by: David Sterba Reviewed-by: Qu Wenruo Thanks for the cle

[PATCH 2/3] fstests: btrfs: Add testcase for btrfs dedupe and metadata balance race test

2017-03-15 Thread Qu Wenruo
Btrfs balance with inband dedupe enable/disable will expose a lot of hidden dedupe bug: 1) Enable/disable race bug 2) Btrfs dedupe tree balance corrupted delayed_ref 3) Btrfs disable and balance will cause balance BUG_ON Reported-by: Satoru Takeuchi Signed-off-by: Qu Wenruo --- tests/btrfs/201

[PATCH] fstests: generic: Test space allocation when there is only fragmented space

2017-03-15 Thread Qu Wenruo
This test case will test if file system works well when handling large write while available space are all fragmented. This can expose a bug in a btrfs unmerged patch, which wrongly modified the delayed allocation code, to exit before allocating all space, and cause hang when unmounting. The wron

[PATCH 3/3] fstests: btrfs: Test inband dedupe with data balance.

2017-03-15 Thread Qu Wenruo
Btrfs balance will reloate date extent, but its hash is removed too late at run_delayed_ref() time, which will cause extent ref increased during balance, cause either find_data_references() gives WARN_ON() or even run_delayed_refs() fails and cause transaction abort. Add such concurrency test for

[PATCH v10 5/5] btrfs-progs: dedupe: introduce reconfigure subcommand

2017-03-15 Thread Qu Wenruo
Introduce reconfigure subcommand to co-operate with new kernel ioctl modification. Signed-off-by: Qu Wenruo --- Documentation/btrfs-dedupe-inband.asciidoc | 7 +++ cmds-dedupe-ib.c | 73 +++--- 2 files changed, 64 insertions(+), 16 deletions(-)

[PATCH v10 0/5] In-band de-duplication for btrfs-progs

2017-03-15 Thread Qu Wenruo
Patchset can be fetched from github: https://github.com/adam900710/btrfs-progs.git dedupe_20170306 Inband dedupe(in-memory backend only) ioctl support for btrfs-progs. User/reviewer/tester can still use previous btrfs-progs patchset to test, this update is just cleanuping unsupported functions, l

[PATCH v10 1/5] btrfs-progs: Basic framework for dedupe-inband command group

2017-03-15 Thread Qu Wenruo
Add basic ioctl header and command group framework for later use. Alone with basic man page doc. Signed-off-by: Qu Wenruo --- Documentation/Makefile.in | 1 + Documentation/btrfs-dedupe-inband.asciidoc | 40 + Documentation/btrfs.asciidoc |

[PATCH v10 2/5] btrfs-progs: dedupe: Add enable command for dedupe command group

2017-03-15 Thread Qu Wenruo
Add enable subcommand for dedupe commmand group. Signed-off-by: Qu Wenruo --- Documentation/btrfs-dedupe-inband.asciidoc | 114 ++- btrfs-completion | 6 +- cmds-dedupe-ib.c | 225 + ioctl.h

[PATCH v10 4/5] btrfs-progs: dedupe: Add status subcommand

2017-03-15 Thread Qu Wenruo
Add status subcommand for dedupe command group. Signed-off-by: Qu Wenruo --- Documentation/btrfs-dedupe-inband.asciidoc | 3 ++ btrfs-completion | 2 +- cmds-dedupe-ib.c | 81 ++ 3 files changed, 85 insertions(+),

[PATCH 0/3] Btrfs in-band de-duplication test cases

2017-03-15 Thread Qu Wenruo
Btrfs in-band de-duplication test cases for in-memory backend, which covers the bugs exposed during the development. Qu Wenruo (3): fstests: btrfs: Add basic test for btrfs in-band de-duplication fstests: btrfs: Add testcase for btrfs dedupe and metadata balance race test fstests: btrfs:

[PATCH v10 3/5] btrfs-progs: dedupe: Add disable support for inband dedupelication

2017-03-15 Thread Qu Wenruo
Add disable subcommand for dedupe command group. Signed-off-by: Qu Wenruo --- Documentation/btrfs-dedupe-inband.asciidoc | 5 btrfs-completion | 2 +- cmds-dedupe-ib.c | 42 ++ 3 files changed, 48 insertions(+

[PATCH 1/3] fstests: btrfs: Add basic test for btrfs in-band de-duplication

2017-03-15 Thread Qu Wenruo
Add basic test for btrfs in-band de-duplication(inmemory backend), including: 1) Enable 3) Dedup rate 4) File correctness 5) Disable Signed-off-by: Qu Wenruo --- common/defrag | 13 ++ tests/btrfs/200 | 116 tests/btrfs/200.out

Re: [PATCH 4/4] btrfs: add dummy callback for readpage_io_failed and drop checks

2017-03-15 Thread Liu Bo
On Mon, Feb 20, 2017 at 07:31:33PM +0100, David Sterba wrote: > Make extent_io_ops::readpage_io_failed_hook callback mandatory and > define a dummy function for btrfs_extent_io_ops. As the failed IO > callback is not performance critical, the branch vs extra trade off does > not hurt. > > Signed-o

Re: Home storage with btrfs

2017-03-15 Thread Kai Krakow
Am Wed, 15 Mar 2017 23:26:32 +0100 schrieb Kai Krakow : > Well, bugs can hit you with every filesystem. Nothing as complex as a Meh... I fooled myself. Find the mistake... ;-) SPOILER: "Nothing" should be "something". -- Regards, Kai Replies to list-only preferred. -- To unsubscribe from th

Re: Home storage with btrfs

2017-03-15 Thread Kai Krakow
Am Wed, 15 Mar 2017 23:41:41 +0100 schrieb Kai Krakow : > Am Wed, 15 Mar 2017 23:26:32 +0100 > schrieb Kai Krakow : > > > Well, bugs can hit you with every filesystem. Nothing as complex as > > a > > Meh... I fooled myself. Find the mistake... ;-) > > SPOILER: > > "Nothing" should be "someth

Re: Home storage with btrfs

2017-03-15 Thread Kai Krakow
Am Wed, 15 Mar 2017 07:55:51 + (UTC) schrieb Duncan <1i5t5.dun...@cox.net>: > Hérikz Nawarro posted on Mon, 13 Mar 2017 08:29:32 -0300 as excerpted: > > > Today is safe to use btrfs for home storage? No raid, just secure > > storage for some files and create snapshots from it. > > > I'll

[PATCH 1/8] nowait aio: Introduce IOCB_RW_FLAG_NOWAIT

2017-03-15 Thread Goldwyn Rodrigues
From: Goldwyn Rodrigues This flag informs kernel to bail out if an AIO request will block for reasons such as file allocations, or a writeback triggered, or would block while allocating requests while performing direct I/O. Unfortunately, aio_flags is not checked for validity. If we add the flag

[PATCH 2/8] nowait aio: Return if cannot get hold of i_rwsem

2017-03-15 Thread Goldwyn Rodrigues
From: Goldwyn Rodrigues A failure to lock i_rwsem would mean there is I/O being performed by another thread. So, let's bail. Reviewed-by: Christoph Hellwig Signed-off-by: Goldwyn Rodrigues --- mm/filemap.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/mm/filemap.c

[PATCH 3/8] nowait aio: return if direct write will trigger writeback

2017-03-15 Thread Goldwyn Rodrigues
From: Goldwyn Rodrigues Find out if the write will trigger a wait due to writeback. If yes, return -EAGAIN. This introduces a new function filemap_range_has_page() which returns true if the file's mapping has a page within the range mentioned. Return -EINVAL for buffered AIO: there are multiple

[PATCH 8/8] nowait aio: btrfs

2017-03-15 Thread Goldwyn Rodrigues
From: Goldwyn Rodrigues Return EAGAIN if any of the following checks fail + i_rwsem is not lockable + NODATACOW or PREALLOC is not set + Cannot nocow at the desired location + Writing beyond end of file which is not allocated Signed-off-by: Goldwyn Rodrigues --- fs/btrfs/file.c | 25 +

[PATCH 7/8] nowait aio: xfs

2017-03-15 Thread Goldwyn Rodrigues
From: Goldwyn Rodrigues If IOCB_NOWAIT is set, bail if the i_rwsem is not lockable immediately. IF IOMAP_NOWAIT is set, return EAGAIN in xfs_file_iomap_begin if it needs allocation either due to file extension, writing to a hole, or COW or waiting for other DIOs to finish. Signed-off-by: Goldwy

[PATCH 5/8] nowait aio: return on congested block device

2017-03-15 Thread Goldwyn Rodrigues
From: Goldwyn Rodrigues A new flag BIO_NOWAIT is introduced to identify bio's orignating from iocb with IOCB_NOWAIT. This flag indicates to return immediately if a request cannot be made instead of retrying. Signed-off-by: Goldwyn Rodrigues --- block/blk-core.c | 12 ++-- bloc

[PATCH 6/8] nowait aio: ext4

2017-03-15 Thread Goldwyn Rodrigues
From: Goldwyn Rodrigues Return EAGAIN if any of the following checks fail for direct I/O: + i_rwsem is lockable + Writing beyond end of file (will trigger allocation) + Blocks are not allocated at the write location Signed-off-by: Goldwyn Rodrigues --- fs/ext4/file.c | 48 ++

[PATCH 4/8] nowait-aio: Introduce IOMAP_NOWAIT

2017-03-15 Thread Goldwyn Rodrigues
From: Goldwyn Rodrigues IOCB_NOWAIT translates to IOMAP_NOWAIT for iomaps. This is used by XFS in the XFS patch. Signed-off-by: Goldwyn Rodrigues --- fs/iomap.c| 2 ++ include/linux/iomap.h | 1 + 2 files changed, 3 insertions(+) diff --git a/fs/iomap.c b/fs/iomap.c index 141c3cd.

[PATCH 0/8 v3] No wait AIO

2017-03-15 Thread Goldwyn Rodrigues
Formerly known as non-blocking AIO. This series adds nonblocking feature to asynchronous I/O writes. io_submit() can be delayed because of a number of reason: - Block allocation for files - Data writebacks for direct I/O - Sleeping because of waiting to acquire i_rwsem - Congested block device

Re: [PATCH v2 0/7] cleanup __btrfs_map_block

2017-03-15 Thread Liu Bo
On Wed, Mar 15, 2017 at 02:07:53PM +0100, David Sterba wrote: > On Tue, Mar 14, 2017 at 01:33:54PM -0700, Liu Bo wrote: > > This is attempting to make __btrfs_map_block less scary :) > > > > The major changes are > > > > 1) split operations for discard out of __btrfs_map_block and we don't copy >

possible deadlock between fsfreeze and asynchronous faults

2017-03-15 Thread Nikolay Borisov
Hello, Here is a nother lockdep splat I got: [ 1131.517411] == [ 1131.518059] [ INFO: possible circular locking dependency detected ] [ 1131.518059] 4.11.0-rc1-nbor #147 Tainted: GW [ 1131.518059]

[PATCH 5/7] btrfs: remove redundant parameter from reada_find_zone

2017-03-15 Thread David Sterba
We can read fs_info from dev. Signed-off-by: David Sterba --- fs/btrfs/reada.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/btrfs/reada.c b/fs/btrfs/reada.c index 5edf7328f67d..c1fc79cd4b2a 100644 --- a/fs/btrfs/reada.c +++ b/fs/btrfs/reada.c @@ -235,10 +235,10 @@

[PATCH 1/7] btrfs: preallocate radix tree node for readahead

2017-03-15 Thread David Sterba
We can preallocate the node so insertion does not have to do that under the lock. The GFP flags for the per-device radix tree are initialized to GFP_NOFS & ~__GFP_DIRECT_RECLAIM but we can use GFP_KERNEL, same as an allocation above anyway, but also because readahead is optional and not on any cri

[PATCH 7/7] btrfs: remove local blocksize variable in reada_find_extent

2017-03-15 Thread David Sterba
The name is misleading and the local variable serves no purpose. Signed-off-by: David Sterba --- fs/btrfs/reada.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/fs/btrfs/reada.c b/fs/btrfs/reada.c index 91df381a60ce..64425c3fe4f5 100644 --- a/fs/btrfs/reada.c +++ b/fs/

[PATCH 4/7] btrfs: remove redundant parameter from btree_readahead_hook

2017-03-15 Thread David Sterba
We can read fs_info from eb. Signed-off-by: David Sterba --- fs/btrfs/ctree.h | 3 +-- fs/btrfs/disk-io.c | 4 ++-- fs/btrfs/reada.c | 4 ++-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h index 29b7fc28c607..173fac68323a 100644 --- a/fs/b

[PATCH 3/7] btrfs: preallocate radix tree node for global readahead tree

2017-03-15 Thread David Sterba
We can preallocate the node so insertion does not have to do that under the lock. The GFP flags for the global radix tree are initialized to GFP_NOFS & ~__GFP_DIRECT_RECLAIM but we can use GFP_KERNEL, because readahead is optional and not on any critical writeout path. Signed-off-by: David Sterba

[PATCH 0/7] Readahead clenups

2017-03-15 Thread David Sterba
I spotted some GFP_NOFS uses in readahead and converted them to GFP_KERNEL with a few cleanups along the way. David Sterba (7): btrfs: preallocate radix tree node for readahead btrfs: use simpler readahead zone lookups btrfs: preallocate radix tree node for global readahead tree btrfs: rem

[PATCH 2/7] btrfs: use simpler readahead zone lookups

2017-03-15 Thread David Sterba
No point using radix_tree_gang_lookup if we're looking up just one slot. Signed-off-by: David Sterba --- fs/btrfs/reada.c | 52 ++-- 1 file changed, 22 insertions(+), 30 deletions(-) diff --git a/fs/btrfs/reada.c b/fs/btrfs/reada.c index fdae8ca79

[PATCH 6/7] btrfs: remove redundant parameter from reada_start_machine_dev

2017-03-15 Thread David Sterba
We can read fs_info from dev. Signed-off-by: David Sterba --- fs/btrfs/reada.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/fs/btrfs/reada.c b/fs/btrfs/reada.c index c1fc79cd4b2a..91df381a60ce 100644 --- a/fs/btrfs/reada.c +++ b/fs/btrfs/reada.c @@ -649,9 +649,9 @@

[PATCH] btrfs: remove unused qgroup members from btrfs_trans_handle

2017-03-15 Thread David Sterba
The members have been effectively unused since "Btrfs: rework qgroup accounting" (fcebe4562dec83b3), there's no substitute for assert_qgroups_uptodate so it's removed as well. Signed-off-by: David Sterba --- fs/btrfs/extent-tree.c | 1 - fs/btrfs/qgroup.c| 12 fs/

Re: [PATCH 1/2] btrfs: provide enumeration for __merge_refs mode argument

2017-03-15 Thread David Sterba
On Mon, Mar 13, 2017 at 02:32:03PM -0600, ednadol...@gmail.com wrote: > @@ -809,14 +814,12 @@ static int __add_missing_keys(struct btrfs_fs_info > *fs_info, > /* > * merge backrefs and adjust counts accordingly > * > - * mode = 1: merge identical keys, if key is set > *FIXME: if we add

Re: [PATCH 2/2] btrfs: replace hardcoded value with SEQ_NONE macro

2017-03-15 Thread David Sterba
On Mon, Mar 13, 2017 at 02:32:04PM -0600, ednadol...@gmail.com wrote: > From: Edmund Nadolski > > Define the SEQ_NONE macro to replace (u64)-1 in places where said > value triggers a special-case ref search behavior. > index 9c41fba..20915a6 100644 > --- a/fs/btrfs/backref.h > +++ b/fs/btrfs/bac

claim of vtagfs feature

2017-03-15 Thread Alexandr Unger
Hi to everyone here! Firstly thank you all for this amasing project! I want to claim "virtual TAG file system" feature to be implemented in BTRFS. What is it? It is a feature to simplify use and search data (files) with common tags. Some tags may be defined as a file attribute, like year of cr

Re: [PATCH v2 0/7] cleanup __btrfs_map_block

2017-03-15 Thread David Sterba
On Tue, Mar 14, 2017 at 01:33:54PM -0700, Liu Bo wrote: > This is attempting to make __btrfs_map_block less scary :) > > The major changes are > > 1) split operations for discard out of __btrfs_map_block and we don't copy > discard operations for the target device of dev replace since they're not

[no subject]

2017-03-15 Thread Alexandr Unger
Hi to everyone here! Firstly thank you all for this amasing project! I want to claim "virtual TAG file system" feature to be implemented in BTRFS. What is it? It is a feature to simplify use and search data (files) with common tags. Some tags may be defined as a file attribute, like year of cr

Re: Home storage with btrfs

2017-03-15 Thread Duncan
Hérikz Nawarro posted on Mon, 13 Mar 2017 08:29:32 -0300 as excerpted: > Today is safe to use btrfs for home storage? No raid, just secure > storage for some files and create snapshots from it. I'll echo the others... but with emphasis on a few caveats the others mentioned but didn't give the e