Re: [PATCH 33/35] btrfs: fix insert_reserved error handling

2018-09-07 Thread Nikolay Borisov
On 30.08.2018 20:42, Josef Bacik wrote: > We were not handling the reserved byte accounting properly for data > references. Metadata was fine, if it errored out the error paths would > free the bytes_reserved count and pin the extent, but it even missed one > of the error cases. So instead

Re: [PATCH 34/35] btrfs: wait on ordered extents on abort cleanup

2018-09-07 Thread Nikolay Borisov
On 30.08.2018 20:42, Josef Bacik wrote: > If we flip read-only before we initiate writeback on all dirty pages for > ordered extents we've created then we'll have ordered extents left over > on umount, which results in all sorts of bad things happening. Fix this > by making sure we wait on

[PATCH v6 0/6] Btrfs: implement swap file support

2018-09-07 Thread Omar Sandoval
From: Omar Sandoval Hi, This series implements swap file support for Btrfs. Compared to v5 [1], this is pretty much feature-complete. It now supports: - Balance (skips block groups containing an active swap file) - Resize (error if trying to shrink past a block group containing an active

[PATCH v6 6/6] Btrfs: support swap files

2018-09-07 Thread Omar Sandoval
From: Omar Sandoval Implement the swap file a_ops on Btrfs. Activation needs to make sure that the file can be used as a swap file, which currently means it must be fully allocated as nocow with no compression on one device. It must also do the proper tracking so that ioctls will not interfere

[PATCH v6 1/6] mm: split SWP_FILE into SWP_ACTIVATED and SWP_FS

2018-09-07 Thread Omar Sandoval
From: Omar Sandoval The SWP_FILE flag serves two purposes: to make swap_{read,write}page() go through the filesystem, and to make swapoff() call ->swap_deactivate(). For Btrfs, we want the latter but not the former, so split this flag into two. This makes us always call ->swap_deactivate() if

[PATCH v6 3/6] vfs: update swap_{,de}activate documentation

2018-09-07 Thread Omar Sandoval
From: Omar Sandoval The documentation for these functions is wrong in several ways: - swap_activate() is called with the inode locked - swap_activate() takes a swap_info_struct * and a sector_t * - swap_activate() can also return a positive number of extents it added itself -

[PATCH v6 4/6] Btrfs: prevent ioctls from interfering with a swap file

2018-09-07 Thread Omar Sandoval
From: Omar Sandoval When a swap file is active, we must make sure that the extents of the file are not moved and that they don't become shared. That means that the following are not safe: - chattr +c (enable compression) - reflink - dedupe - snapshot - defrag Don't allow those to happen on an

[PATCH v6 5/6] Btrfs: rename get_chunk_map() and make it non-static

2018-09-07 Thread Omar Sandoval
From: Omar Sandoval The Btrfs swap code is going to need it, so give it a btrfs_ prefix and make it non-static. Signed-off-by: Omar Sandoval --- fs/btrfs/volumes.c | 22 +++--- fs/btrfs/volumes.h | 9 + 2 files changed, 20 insertions(+), 11 deletions(-) diff --git

[PATCH v6 2/6] mm: export add_swap_extent()

2018-09-07 Thread Omar Sandoval
From: Omar Sandoval Btrfs will need this for swap file support. Signed-off-by: Omar Sandoval --- mm/swapfile.c | 1 + 1 file changed, 1 insertion(+) diff --git a/mm/swapfile.c b/mm/swapfile.c index d3f95833d12e..51cb30de17bc 100644 --- a/mm/swapfile.c +++ b/mm/swapfile.c @@ -2365,6 +2365,7

Re: btrfs send hung in pipe_wait

2018-09-07 Thread Stefan Loewen
Well... It seems it's not the hardware. I ran a long SMART check which ran through without errors and reallocation count is still 0. So I used clonezilla (partclone.btrfs) to mirror the drive to another drive (same model). Everything copied over just fine. No I/O error im dmesg. The new disk

Re: compiling btrfs-progs 4.17.1 gives error "reiserfs/misc.h: No such file or directory"

2018-09-07 Thread Chris Murphy
On Fri, Sep 7, 2018 at 3:56 AM, Jürgen Herrmann wrote: > Hello! > > I'm having a problem with btrfs send which stops after several seconds. > The process hangs with 100% cpu time on one cpu. The system is still > responsive to input but no io is happening anymore so the system > basically becomes

Re: [PATCH v6 6/6] Btrfs: support swap files

2018-09-07 Thread Omar Sandoval
On Fri, Sep 07, 2018 at 11:39:25AM +0300, Nikolay Borisov wrote: > > > On 7.09.2018 10:39, Omar Sandoval wrote: > > From: Omar Sandoval > > > > Implement the swap file a_ops on Btrfs. Activation needs to make sure > > that the file can be used as a swap file, which currently means it must > >

Re: [PATCH] Btrfs: use correct args for kcalloc in btrfsic_read_block

2018-09-07 Thread Omar Sandoval
On Sat, Sep 08, 2018 at 01:59:50AM +0800, Liu Bo wrote: > kcalloc is defined as > kcalloc(size_t n, size_t size, gfp_t flags) > > Although this won't cause problems in practice, btrfsic_read_block() > has switched n with size. > > This updates btrfsic_read_block() to be correct in using kcalloc.

Re: [PATCH] Btrfs: use correct args for kcalloc in btrfsic_read_block

2018-09-07 Thread Liu Bo
On Fri, Sep 7, 2018 at 11:21 AM, Omar Sandoval wrote: > On Sat, Sep 08, 2018 at 01:59:50AM +0800, Liu Bo wrote: >> kcalloc is defined as >> kcalloc(size_t n, size_t size, gfp_t flags) >> >> Although this won't cause problems in practice, btrfsic_read_block() >> has switched n with size. >> >>

Re: btrfs send hung in pipe_wait

2018-09-07 Thread Chris Murphy
On Fri, Sep 7, 2018 at 6:47 AM, Stefan Loewen wrote: > Well... It seems it's not the hardware. > I ran a long SMART check which ran through without errors and > reallocation count is still 0. That only checks the drive, it's an internal test. It doesn't check anything else, including

[PATCH] Btrfs: use correct args for kcalloc in btrfsic_read_block

2018-09-07 Thread Liu Bo
kcalloc is defined as kcalloc(size_t n, size_t size, gfp_t flags) Although this won't cause problems in practice, btrfsic_read_block() has switched n with size. This updates btrfsic_read_block() to be correct in using kcalloc. Signed-off-by: Liu Bo --- fs/btrfs/check-integrity.c | 6 +++--- 1

Re: [PATCH v6 6/6] Btrfs: support swap files

2018-09-07 Thread Omar Sandoval
On Fri, Sep 07, 2018 at 11:04:28AM -0700, Omar Sandoval wrote: > On Fri, Sep 07, 2018 at 11:39:25AM +0300, Nikolay Borisov wrote: > > > > > > On 7.09.2018 10:39, Omar Sandoval wrote: > > > From: Omar Sandoval > > > > > > Implement the swap file a_ops on Btrfs. Activation needs to make sure >

Re: btrfs send hung in pipe_wait

2018-09-07 Thread Stefan Loewen
List of steps: - 3.8G iso lays in read-only subvol A - I create subvol B and reflink-copy the iso into it. - I create a read-only snapshot C of B - I "btrfs send --no-data C > /somefile" So you got that right, yes. Unfortunately I don't have any way to connect the drive to a SATA port directly

Re: compiling btrfs-progs 4.17.1 gives error "reiserfs/misc.h: No such file or directory"

2018-09-07 Thread David Sterba
On Fri, Sep 07, 2018 at 12:51:54PM +0200, Jürgen Herrmann wrote: > Am 7.9.2018 12:38, schrieb David Sterba: > > On Fri, Sep 07, 2018 at 11:56:18AM +0200, Jürgen Herrmann wrote: > >> I'm on linux mint 19, freshly installed on a new laptop about 6 weeks > >> ago. So i wanted to compile latest

[PATCH 00/11] Cleanup dev-replace locking

2018-09-07 Thread David Sterba
The series peels off the custom locking that's used for dev-replace and uses read-write semaphore in the end. I've mainly focused on correctness and haven't measured the performance effects. There should be none as the blocking and waiting was merely open coding what the rw semaphore does, but

[PATCH 02/11] btrfs: open code btrfs_dev_replace_clear_lock_blocking

2018-09-07 Thread David Sterba
There's a single caller and the function name does not say it's actually taking the lock, so open coding makes it more explicit. For now, btrfs_dev_replace_read_lock is used instead of read_lock so it's paired with the unlocking wrapper in the same block. Signed-off-by: David Sterba ---

[PATCH 04/11] btrfs: open code btrfs_after_dev_replace_commit

2018-09-07 Thread David Sterba
Too trivial, the purpose can be simply documented in a comment. Signed-off-by: David Sterba --- fs/btrfs/dev-replace.c | 8 fs/btrfs/dev-replace.h | 1 - fs/btrfs/transaction.c | 5 - 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/fs/btrfs/dev-replace.c

[PATCH 05/11] btrfs: dev-replace: avoid useless lock on error handling path

2018-09-07 Thread David Sterba
The exit sequence in btrfs_dev_replace_start does not allow to simply add a label to the right place so the error handling after starting transaction failure jumps there. Currently there's a lock that pairs with the unlock in the section, which is unnecessary and only raises questions. Add a

Re: dduper - Offline btrfs deduplication tool

2018-09-07 Thread Adam Borowski
On Fri, Sep 07, 2018 at 09:27:28AM +0530, Lakshmipathi.G wrote: > > One question: > > Why not ioctl_fideduperange? > > i.e. you kill most of benefits from that ioctl - atomicity. > > > I plan to add fideduperange as an option too. User can > choose between fideduperange and ficlonerange call. >

Re: [PATCH 0/3] btrfs: qgroup: Deprecate unused features for btrfs_qgroup_inherit()

2018-09-07 Thread David Sterba
On Thu, Sep 06, 2018 at 09:25:45PM +0800, Qu Wenruo wrote: > > The deprecation should be done in a few steps. First issue a warning > > that the feature is deprecated and will be removed in release X. Then > > wait until somebody complains (or not) and remove the code in release X. > > > > The X

[PATCH 01/11] btrfs: remove btrfs_dev_replace::read_locks

2018-09-07 Thread David Sterba
This member seems to be copied from the extent_buffer locking scheme and is at least used to assert that the read lock/unlock is properly nested. In some way. While the _inc/_dec are called inside the read lock section, the asserts are both inside and outside, so the ordering is not guaranteed and

[PATCH 03/11] btrfs: open code btrfs_dev_replace_stats_inc

2018-09-07 Thread David Sterba
The wrapper is too trivial, open coding does not make it less readable. Signed-off-by: David Sterba --- fs/btrfs/dev-replace.h | 5 - fs/btrfs/scrub.c | 11 --- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/fs/btrfs/dev-replace.h b/fs/btrfs/dev-replace.h

[PATCH 08/11] btrfs: reada: reorder dev-replace locks before radix tree preload

2018-09-07 Thread David Sterba
The read lock is going to use rw semaphore that might sleep, this is not possible in the radix tree preload section. The lock nesting is now: * device replace * radix tree preload * readahead spinlock Signed-off-by: David Sterba --- fs/btrfs/reada.c | 12 +++- 1 file changed, 7

[PATCH 10/11] btrfs: dev-replace: remove custom read/write blocking scheme

2018-09-07 Thread David Sterba
After the rw semaphore has been added, the custom blocking using ::blocking_readers and ::read_lock_wq is redundant. The blocking logic in __btrfs_map_block is replaced by extending the time the semaphore is held, that has the same blocking effect on writes as the previous custom scheme that

[PATCH 07/11] btrfs: dev-replace: remove pointless assert in write unlock

2018-09-07 Thread David Sterba
The value of blocking_readers is increased only when the lock is taken for read, no way we can fail the condition with the write lock. Signed-off-by: David Sterba --- fs/btrfs/dev-replace.c | 1 - 1 file changed, 1 deletion(-) diff --git a/fs/btrfs/dev-replace.c b/fs/btrfs/dev-replace.c index

[PATCH 06/11] btrfs: dev-replace: move replace members out of fs_info

2018-09-07 Thread David Sterba
The replace_wait and bio_counter were mistakenly added to fs_info in commit c404e0dc2c843b154f ("Btrfs: fix use-after-free in the finishing procedure of the device replace"), but they logically belong to fs_info::dev_replace. Besides, bio_counter is a very generic name and is confusing in bare

[PATCH 11/11] btrfs: dev-replace: open code trivial locking helpers

2018-09-07 Thread David Sterba
The dev-replace locking functions are now trivial wrappers around rw semaphore that can be used directly everywhere. No functional change. Signed-off-by: David Sterba --- fs/btrfs/dev-replace.c | 73 -- fs/btrfs/dev-replace.h | 4 --- fs/btrfs/reada.c

Re: [PATCH RESEND] btrfs: fix error handling in free_log_tree

2018-09-07 Thread Jeff Mahoney
On 9/7/18 8:00 AM, David Sterba wrote: > On Thu, Sep 06, 2018 at 04:59:33PM -0400, je...@suse.com wrote: >> From: Jeff Mahoney > > If this is a resend, I can't find the previous postings, same or similar > subject. I had tagged it as submitted in March, but I can't find any posting of it

Re: List of known BTRFS Raid 5/6 Bugs?

2018-09-07 Thread Stefan K
sorry for disturb this discussion, are there any plans/dates to fix the raid5/6 issue? Is somebody working on this issue? Cause this is for me one of the most important things for a fileserver, with a raid1 config I loose to much diskspace. best regards Stefan

Re: compiling btrfs-progs 4.17.1 gives error "reiserfs/misc.h: No such file or directory"

2018-09-07 Thread Jürgen Herrmann
Am 7.9.2018 13:13, schrieb Qu Wenruo: On 2018/9/7 下午6:45, Jürgen Herrmann wrote: Am 7.9.2018 12:15, schrieb Qu Wenruo: On 2018/9/7 下午5:56, Jürgen Herrmann wrote: Hello! I'm having a problem with btrfs send which stops after several seconds. The process hangs with 100% cpu time on one cpu.

Re: [PATCH v6 5/6] Btrfs: rename get_chunk_map() and make it non-static

2018-09-07 Thread Nikolay Borisov
On 7.09.2018 10:39, Omar Sandoval wrote: > From: Omar Sandoval > > The Btrfs swap code is going to need it, so give it a btrfs_ prefix and > make it non-static. > > Signed-off-by: Omar Sandoval One minor nit but otherwise: Reviewed-by: Nikolay Borisov > --- > fs/btrfs/volumes.c | 22

Re: [PATCH v6 6/6] Btrfs: support swap files

2018-09-07 Thread Nikolay Borisov
On 7.09.2018 10:39, Omar Sandoval wrote: > From: Omar Sandoval > > Implement the swap file a_ops on Btrfs. Activation needs to make sure > that the file can be used as a swap file, which currently means it must > be fully allocated as nocow with no compression on one device. It must > also

[PATCH v2 3/5] btrfs: qgroup: Introduce function to find all new tree blocks of reloc tree

2018-09-07 Thread Qu Wenruo
Introduce new function, qgroup_trace_new_subtree_blocks(), to iterate all new tree blocks in a reloc tree. So that qgroup could skip unrelated tree blocks during balance, which should hugely speedup balance speed when quota is enabled. The function qgroup_trace_new_subtree_blocks() itself only

[PATCH v2 0/5] btrfs: qgroup: Skip unrelated tree blocks for balance

2018-09-07 Thread Qu Wenruo
This patchset can be fetched from github: https://github.com/adam900710/linux/tree/qgroup_balance_skip_trees The base commit is v4.19-rc1 tag. There are a lot of reports of system hang for balance on quota enabled fs. It's most obvious for large fs. The hang is caused by tons of unmodified

[PATCH v2 4/5] btrfs: qgroup: Use generation aware subtree swap to mark dirty extents

2018-09-07 Thread Qu Wenruo
Before this patch, for quota enabled balance, btrfs needs to mark the whole subtree dirty for quota. E.g. OO = Old tree blocks (from file tree) NN = New tree blocks (from reloc tree) File tree (src) Reloc tree (dst) OO (a) NN (a)

[PATCH v2 2/5] btrfs: qgroup: Introduce function to trace two swaped extents

2018-09-07 Thread Qu Wenruo
Introduce a new function, qgroup_trace_extent_swap(), which will be used later for balance qgroup speedup. The basis idea of balance is swapping tree blocks between reloc tree and the real file tree. The swap will happen in highest tree block, but there may be a lot of tree blocks involved. For

[PATCH v2 1/5] btrfs: qgroup: Introduce trace event to analyse the number of dirty extents accounted

2018-09-07 Thread Qu Wenruo
Number of qgroup dirty extents is directly linked to the performance overhead, so add a new trace event, trace_qgroup_num_dirty_extents(), to record how many dirty extents is processed in btrfs_qgroup_account_extents(). This will be pretty handy to analyse later balance performance improvement.

[PATCH v2 5/5] btrfs: qgroup: Don't trace subtree if we're dropping reloc tree

2018-09-07 Thread Qu Wenruo
Reloc tree doesn't contribute to qgroup numbers, as we have accounted them at balance time (check replace_path()). Skip such unneeded subtree trace should reduce some performance overhead. Signed-off-by: Qu Wenruo --- fs/btrfs/extent-tree.c | 8 +++- 1 file changed, 7 insertions(+), 1

[PATCH v3.1 0/2] btrfs: trim enhancement to allow btrfs really trim block groups

2018-09-07 Thread Qu Wenruo
This patchset can be fetched from github: https://github.com/adam900710/linux/tree/trim_fix Which is based on v4.19-rc1 tag. This patchset introduces 2 enhancement, one to output better error messages during trim, the other one is to ensure we could really trim block groups if logical bytenr of

[PATCH v3.1 1/2] btrfs: Enhance btrfs_trim_fs function to handle error better

2018-09-07 Thread Qu Wenruo
Function btrfs_trim_fs() doesn't handle errors in a consistent way, if error happens when trimming existing block groups, it will skip the remaining blocks and continue to trim unallocated space for each device. And the return value will only reflect the final error from device trimming. This

[PATCH v3.1 2/2] btrfs: Ensure btrfs_trim_fs can trim the whole fs

2018-09-07 Thread Qu Wenruo
[BUG] fstrim on some btrfs only trims the unallocated space, not trimming any space in existing block groups. [CAUSE] Before fstrim_range passed to btrfs_trim_fs(), it get truncated to range [0, super->total_bytes). So later btrfs_trim_fs() will only be able to trim block groups in range [0,

Re: compiling btrfs-progs 4.17.1 gives error "reiserfs/misc.h: No such file or directory"

2018-09-07 Thread Qu Wenruo
On 2018/9/7 下午5:56, Jürgen Herrmann wrote: > Hello! > > I'm having a problem with btrfs send which stops after several seconds. > The process hangs with 100% cpu time on one cpu. The system is still > responsive to input but no io is happening anymore so the system > basically becomes

Re: compiling btrfs-progs 4.17.1 gives error "reiserfs/misc.h: No such file or directory"

2018-09-07 Thread David Sterba
On Fri, Sep 07, 2018 at 11:56:18AM +0200, Jürgen Herrmann wrote: > I'm on linux mint 19, freshly installed on a new laptop about 6 weeks > ago. So i wanted to compile latest btrfs-progs and latest stable kernel > first before reporting that here, BUT: I cannot compile btrfs-progs > 4.17.1 >

Re: compiling btrfs-progs 4.17.1 gives error "reiserfs/misc.h: No such file or directory"

2018-09-07 Thread Jürgen Herrmann
Am 7.9.2018 12:15, schrieb Qu Wenruo: On 2018/9/7 下午5:56, Jürgen Herrmann wrote: Hello! I'm having a problem with btrfs send which stops after several seconds. The process hangs with 100% cpu time on one cpu. The system is still responsive to input but no io is happening anymore so the

Re: compiling btrfs-progs 4.17.1 gives error "reiserfs/misc.h: No such file or directory"

2018-09-07 Thread Jürgen Herrmann
Am 7.9.2018 12:38, schrieb David Sterba: On Fri, Sep 07, 2018 at 11:56:18AM +0200, Jürgen Herrmann wrote: I'm on linux mint 19, freshly installed on a new laptop about 6 weeks ago. So i wanted to compile latest btrfs-progs and latest stable kernel first before reporting that here, BUT: I

Re: compiling btrfs-progs 4.17.1 gives error "reiserfs/misc.h: No such file or directory"

2018-09-07 Thread Jürgen Herrmann
Am 7.9.2018 12:15, schrieb Qu Wenruo: On 2018/9/7 下午5:56, Jürgen Herrmann wrote: Hello! I'm having a problem with btrfs send which stops after several seconds. The process hangs with 100% cpu time on one cpu. The system is still responsive to input but no io is happening anymore so the

compiling btrfs-progs 4.17.1 gives error "reiserfs/misc.h: No such file or directory"

2018-09-07 Thread Jürgen Herrmann
Hello! I'm having a problem with btrfs send which stops after several seconds. The process hangs with 100% cpu time on one cpu. The system is still responsive to input but no io is happening anymore so the system basically becomes unuseable. I'm on linux mint 19, freshly installed on a new

Re: [PATCH v6 5/6] Btrfs: rename get_chunk_map() and make it non-static

2018-09-07 Thread David Sterba
On Fri, Sep 07, 2018 at 10:54:52AM +0300, Nikolay Borisov wrote: > > > On 7.09.2018 10:39, Omar Sandoval wrote: > > From: Omar Sandoval > > > > The Btrfs swap code is going to need it, so give it a btrfs_ prefix and > > make it non-static. > > > > Signed-off-by: Omar Sandoval > > One minor

[PATCH v2 3/3] btrfs: qgroup: Prepare to deprecate some btrfs_qgroup_inherit features

2018-09-07 Thread Qu Wenruo
Prepare to deprecate the following btrfs_qgroup_inherit features: 1) Flags There is only one flag supported, BTRFS_QGROUP_INHERIT_SET_LIMITS, however it's never used by btrfs-progs. 2) num_excl|ref_copies These two features are going to copy excl/rfer numbers from one qgroup to

[PATCH v2 2/3] btrfs: qgroup: Validate btrfs_qgroup_inherit structure before passing it to qgroup

2018-09-07 Thread Qu Wenruo
btrfs_qgroup_inherit structure doesn't goes through much validation check. Now do a comprehensive check for it, including: 1) Inherit size Should not exceeding SZ_4K and its num_qgroups should not exceed its size passed in btrfs_ioctl_vol_args_v2. 2) Flags Should not include any unknown

[PATCH v2 0/3] btrfs: qgroup: Prepare to deprecate unused features for btrfs_qgroup_inherit()

2018-09-07 Thread Qu Wenruo
This patchset can be fetched from github: https://github.com/adam900710/linux/tree/qgroup_inherit_check Which is based on v4.19-rc1 tag. This patchset will firstly set btrfs_qgroup_inherit structure size limit from PAGE_SIZE to fixed SZ_4K. I understand this normally will cause compatibility

[PATCH v2 1/3] btrfs: Set qgroup inherit size limit to SZ_4K instead of page size

2018-09-07 Thread Qu Wenruo
Change btrfs_qgroup_inherit maximum size from PAGE_SIZE to SZ_4K to make it consistent across different architectures. This change will only affect architectures whose page size is not (larger than) 4K, and will only affect how many qgroups can exist in btrfs_qgroup_inherit structure: Before:

Re: [PATCH 03/35] btrfs: use cleanup_extent_op in check_ref_cleanup

2018-09-07 Thread David Sterba
On Fri, Aug 31, 2018 at 04:00:29PM -0700, Omar Sandoval wrote: > On Thu, Aug 30, 2018 at 01:41:53PM -0400, Josef Bacik wrote: > > From: Josef Bacik > > > > Unify the extent_op handling as well, just add a flag so we don't > > actually run the extent op from check_ref_cleanup and instead return a

Re: btrfs send hung in pipe_wait

2018-09-07 Thread Chris Murphy
On Fri, Sep 7, 2018 at 11:07 AM, Stefan Loewen wrote: > List of steps: > - 3.8G iso lays in read-only subvol A > - I create subvol B and reflink-copy the iso into it. > - I create a read-only snapshot C of B > - I "btrfs send --no-data C > /somefile" > So you got that right, yes. OK I can't

[PATCH v2] Btrfs: use correct args for kcalloc in btrfsic_read_block

2018-09-07 Thread Liu Bo
kcalloc is defined as kcalloc(size_t n, size_t size, gfp_t flags) Although this won't cause problems in practice, btrfsic_read_block() has switched n with size. This updates btrfsic_read_block() to be correct in using kcalloc. Reviewed-by: Omar Sandoval Signed-off-by: Liu Bo --- v2: use

Re: [PATCH 3/3] btrfs: qgroup: Remove deprecated feature support in btrfs_qgorup_inhert()

2018-09-07 Thread Omar Sandoval
On Fri, Aug 31, 2018 at 10:29:30AM +0800, Qu Wenruo wrote: > Since btrfs_validate_inherit() will not allow features like copy > rfer/excl and limit set, remove these dead code. Reviewed-by: Omar Sandoval > Signed-off-by: Qu Wenruo > --- > fs/btrfs/qgroup.c | 57

Re: [PATCH 03/11] btrfs: open code btrfs_dev_replace_stats_inc

2018-09-07 Thread Omar Sandoval
On Fri, Sep 07, 2018 at 04:55:06PM +0200, David Sterba wrote: > The wrapper is too trivial, open coding does not make it less readable. Reviewed-by: Omar Sandoval > Signed-off-by: David Sterba > --- > fs/btrfs/dev-replace.h | 5 - > fs/btrfs/scrub.c | 11 --- > 2 files

Re: [PATCH 04/11] btrfs: open code btrfs_after_dev_replace_commit

2018-09-07 Thread Omar Sandoval
On Fri, Sep 07, 2018 at 04:55:09PM +0200, David Sterba wrote: > Too trivial, the purpose can be simply documented in a comment. Reviewed-by: Omar Sandoval > Signed-off-by: David Sterba > --- > fs/btrfs/dev-replace.c | 8 > fs/btrfs/dev-replace.h | 1 - > fs/btrfs/transaction.c | 5

Re: [PATCH 2/3] btrfs: qgroup: Validate btrfs_qgroup_inherit structure before passing it to qgroup

2018-09-07 Thread Omar Sandoval
On Fri, Aug 31, 2018 at 10:29:29AM +0800, Qu Wenruo wrote: > btrfs_qgroup_inherit structure doesn't goes through much validation > check. > > Now do a comprehensive check for it, including: > 1) inherit size >Should not exceeding SZ_4K and its num_qgroups should not >exceed its size

Re: [PATCH 05/11] btrfs: dev-replace: avoid useless lock on error handling path

2018-09-07 Thread Omar Sandoval
On Fri, Sep 07, 2018 at 04:55:11PM +0200, David Sterba wrote: > The exit sequence in btrfs_dev_replace_start does not allow to simply > add a label to the right place so the error handling after starting > transaction failure jumps there. Currently there's a lock that pairs > with the unlock in

Re: [PATCH 06/11] btrfs: dev-replace: move replace members out of fs_info

2018-09-07 Thread Omar Sandoval
On Fri, Sep 07, 2018 at 04:55:13PM +0200, David Sterba wrote: > The replace_wait and bio_counter were mistakenly added to fs_info in > commit c404e0dc2c843b154f ("Btrfs: fix use-after-free in the finishing > procedure of the device replace"), but they logically belong to > fs_info::dev_replace.

Re: [PATCH 2/3] btrfs: qgroup: Validate btrfs_qgroup_inherit structure before passing it to qgroup

2018-09-07 Thread Qu Wenruo
On 2018/9/8 上午4:50, Omar Sandoval wrote: > On Fri, Aug 31, 2018 at 10:29:29AM +0800, Qu Wenruo wrote: >> btrfs_qgroup_inherit structure doesn't goes through much validation >> check. >> >> Now do a comprehensive check for it, including: >> 1) inherit size >>Should not exceeding SZ_4K and its

Re: dduper - Offline btrfs deduplication tool

2018-09-07 Thread Zygo Blaxell
On Fri, Sep 07, 2018 at 09:27:28AM +0530, Lakshmipathi.G wrote: > > > > One question: > > Why not ioctl_fideduperange? > > i.e. you kill most of benefits from that ioctl - atomicity. > > > I plan to add fideduperange as an option too. User can > choose between fideduperange and ficlonerange

Re: compiling btrfs-progs 4.17.1 gives error "reiserfs/misc.h: No such file or directory"

2018-09-07 Thread Qu Wenruo
On 2018/9/7 下午6:45, Jürgen Herrmann wrote: > Am 7.9.2018 12:15, schrieb Qu Wenruo: >> On 2018/9/7 下午5:56, Jürgen Herrmann wrote: >>> Hello! >>> >>> I'm having a problem with btrfs send which stops after several seconds. >>> The process hangs with 100% cpu time on one cpu. The system is still >>>

Re: [PATCH] btrfs: extent-tree.c: Remove redundant variable from btrfs_cross_ref_exist()

2018-09-07 Thread David Sterba
On Fri, Sep 07, 2018 at 12:01:21PM +0900, Misono Tomohiro wrote: > On 2018/09/07 0:57, David Sterba wrote: > > On Thu, Aug 30, 2018 at 10:59:16AM +0900, Misono Tomohiro wrote: > >> Since commit d7df2c796d7e ("Btrfs attach delayed ref updates to > >> delayed ref heads"), check_delaed_ref() won't

Re: [PATCH RESEND] btrfs: fix error handling in free_log_tree

2018-09-07 Thread David Sterba
On Thu, Sep 06, 2018 at 04:59:33PM -0400, je...@suse.com wrote: > From: Jeff Mahoney If this is a resend, I can't find the previous postings, same or similar subject. > When we hit an I/O error in free_log_tree->walk_log_tree during file system > shutdown we can crash due to there not being a