Re: btrfs problems

2018-09-21 Thread Duncan
Adrian Bastholm posted on Thu, 20 Sep 2018 23:35:57 +0200 as excerpted: > Thanks a lot for the detailed explanation. > Aabout "stable hardware/no lying hardware". I'm not running any raid > hardware, was planning on just software raid. three drives glued > together with "mkfs.btrfs -d raid5 /dev/s

Re: [RFC PATCH v2 0/4] btrfs-progs: build distinct binaries for specific btrfs subcommands

2018-09-21 Thread Duncan
Axel Burri posted on Fri, 21 Sep 2018 11:46:37 +0200 as excerpted: > I think you got me wrong here: There will not be binaries with the same > filename. I totally agree that this would be a bad thing, no matter if > you have bin/sbin merged or not, you'll end up in either having a > collision or (

Re: [PATCH 00/22] various dynamic_debug patches

2018-09-21 Thread Jason Baron
On 09/19/2018 06:04 PM, Rasmus Villemoes wrote: > This started as an experiment to see how hard it would be to change > the four pointers in struct _ddebug into relative offsets, a la > CONFIG_GENERIC_BUG_RELATIVE_POINTERS, thus saving 16 bytes per > pr_debug site (and thus exactly making up for th

Re: [PATCH 5/6] btrfs-progs: check: Add support for freespace tree fixing

2018-09-21 Thread Omar Sandoval
On Fri, Jun 15, 2018 at 02:06:01PM +0300, Nikolay Borisov wrote: > Now that all the prerequisite code for proper support of free space > tree repair is in, it's time to wire it in. This is achieved by first > hooking the freespace tree to the __free_extent/alloc_reserved_tree_block > functions. And

Re: [PATCH 4/6] btrfs-progs: Add freespace tree as compat_ro supported feature

2018-09-21 Thread Omar Sandoval
On Fri, Jun 15, 2018 at 02:06:00PM +0300, Nikolay Borisov wrote: > The RO_FREE_SPACE_TREE(_VALID) flags are required in order to be able > to open an FST filesystem in repair mode. Add them to > BTRFS_FEATURE_COMPAT_RO_SUPP. > > Signed-off-by: Nikolay Borisov > --- > ctree.h | 4 +++- > 1 file c

Re: [PATCH 3/6] btrfs-progs: Pull free space tree related code from kernel

2018-09-21 Thread Nikolay Borisov
On 21.09.2018 23:19, Omar Sandoval wrote: > On Fri, Jun 15, 2018 at 02:05:59PM +0300, Nikolay Borisov wrote: >> To help implement free space tree checker in user space some kernel >> function are necessary, namely iterating/deleting/adding freespace >> items, some internal search functions. Func

Re: [PATCH 3/6] btrfs-progs: Pull free space tree related code from kernel

2018-09-21 Thread Omar Sandoval
On Fri, Jun 15, 2018 at 02:05:59PM +0300, Nikolay Borisov wrote: > To help implement free space tree checker in user space some kernel > function are necessary, namely iterating/deleting/adding freespace > items, some internal search functions. Functions to populate a block > group based on the ext

Re: [PATCH 2/6] btrfs-progs: Add extent buffer bitmap manipulation infrastructure

2018-09-21 Thread Omar Sandoval
On Fri, Jun 15, 2018 at 02:05:58PM +0300, Nikolay Borisov wrote: > Those functions are in preparation for adding the freespace tree > repair code since it needs to be able to deal with bitmap based fsts. > This patch adds extent_buffer_bitmap_set and extent_buffer_bitmap_clear > functions. Since in

Re: [PATCH 1/6] btrfs-progs: Add support for freespace tree in btrfs_read_fs_root

2018-09-21 Thread Omar Sandoval
On Fri, Jun 15, 2018 at 02:05:57PM +0300, Nikolay Borisov wrote: > For completeness sake add code to btrfs_read_fs_root so that it can > handle the freespace tree. Reviewed-by: Omar Sandoval > Signed-off-by: Nikolay Borisov > --- > disk-io.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff

Re: [PATCH 1/3] btrfs: Import kernel zstd

2018-09-21 Thread Nick Terrell
> On Sep 21, 2018, at 11:10 AM, Daniel Kiper wrote: > > On Mon, Aug 27, 2018 at 06:36:52PM -0700, Nick Terrell wrote: >> Import xxhash and zstd from the upstream kernel as-is. This will not >> compile. The next patch in the series contains all the changes needed to >> make zstd compile in grub

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

2018-09-21 Thread Omar Sandoval
On Fri, Sep 21, 2018 at 05:17:35PM +0200, David Sterba wrote: > On Thu, Sep 20, 2018 at 10:41:24AM -0700, Omar Sandoval wrote: > > On Thu, Sep 20, 2018 at 07:22:55PM +0200, David Sterba wrote: > > > On Wed, Sep 19, 2018 at 10:02:11PM -0700, Omar Sandoval wrote: > > > > From: Omar Sandoval > > > >

Re: [PATCH 3/3] btrfs: Add zstd support to btrfs

2018-09-21 Thread Daniel Kiper
On Mon, Aug 27, 2018 at 06:36:54PM -0700, Nick Terrell wrote: > Adds zstd support to the btrfs module. I'm not sure that my changes to the > Makefiles are correct, please let me know if I need to do something > differently. > > Tested on Ubuntu-18.04 with a btrfs /boot partition with and without zs

Re: [PATCH 2/3] btrfs: Patch the kernel zstd

2018-09-21 Thread Daniel Kiper
On Mon, Aug 27, 2018 at 06:36:53PM -0700, Nick Terrell wrote: > Applies patches to the upstream kernel zstd needed to compile in grub. > * Replace kernel headers with "kerncompat.h". > * Replace the unaligned memory access functions. > * Add fallthrough statements for newer gcc versions. > * Rename

Re: [PATCH 1/3] btrfs: Import kernel zstd

2018-09-21 Thread Daniel Kiper
On Mon, Aug 27, 2018 at 06:36:52PM -0700, Nick Terrell wrote: > Import xxhash and zstd from the upstream kernel as-is. This will not > compile. The next patch in the series contains all the changes needed to > make zstd compile in grub. Only the files needed for decompression are > imported from zs

Re: [PATCH] btrfs: use common helper instead of open coding a bit test

2018-09-21 Thread Nikolay Borisov
On 21.09.2018 15:26, David Sterba wrote: > The helper does the same math and we take care about the special case > when flags is 0 too. > > Signed-off-by: David Sterba Reviewed-by: Nikolay Borisov > --- > fs/btrfs/volumes.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --

Re: [PATCH v2] Btrfs: remove wait_ordered_rane in btrfs_evict_inode

2018-09-21 Thread David Sterba
On Sat, Sep 15, 2018 at 05:03:28AM +0800, Liu Bo wrote: > When we delete an inode, > > btrfs_evict_inode() { > truncate_inode_pages_final() > truncate_inode_pages_range() > lock_page() > truncate_cleanup_page() > btrfs_invalidatepage() >

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

2018-09-21 Thread David Sterba
On Thu, Sep 20, 2018 at 10:22:57AM -0700, Omar Sandoval wrote: > > > + /* > > > + * Balance or device remove/replace/resize can move stuff around from > > > + * under us. The EXCL_OP flag makes sure they aren't running/won't run > > > + * concurrently while we are mapping the swap extents, and >

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

2018-09-21 Thread David Sterba
On Thu, Sep 20, 2018 at 10:41:24AM -0700, Omar Sandoval wrote: > On Thu, Sep 20, 2018 at 07:22:55PM +0200, David Sterba wrote: > > On Wed, Sep 19, 2018 at 10:02:11PM -0700, Omar Sandoval wrote: > > > From: Omar Sandoval > > > Changes from v7 [1]: > > > > > > - Expanded a few commit messages > > >

Re: [PATCH 0/3] Refactor delayed refs processing loop

2018-09-21 Thread David Sterba
On Wed, Aug 15, 2018 at 10:39:53AM +0300, Nikolay Borisov wrote: > Here is a small series which aims to rectify the eye sore that delayed refs > processing loop currently is. In fact, it's actually 2 loops in the guise of > a > single 'while' construct. All in all this should bring no functional

Re: [PATCH 2/3] btrfs: Factor out loop processing all refs of a head

2018-09-21 Thread David Sterba
On Wed, Aug 15, 2018 at 10:39:55AM +0300, Nikolay Borisov wrote: > This patch introduces a new helper encompassing the implicit inner loop > in __btrfs_run_delayed_refs which processes all the refs for a given > head. The code is mostly copy/paste, the only difference is that if we > detect a newer

Re: [PATCH 3/3] btrfs: refactor __btrfs_run_delayed_refs loop

2018-09-21 Thread David Sterba
On Wed, Aug 15, 2018 at 10:39:56AM +0300, Nikolay Borisov wrote: > Refactor the delayed refs loop by using the newly introduced > btrfs_run_delayed_refs_for_head function. This greatly simplifies > __btrfs_run_delayed_refs and makes it more obvious what is happening. > We now have 1 loop which iter

Re: [PATCH 1/3] btrfs: Factor out ref head locking code in __btrfs_run_delayed_refs

2018-09-21 Thread David Sterba
On Wed, Aug 15, 2018 at 10:39:54AM +0300, Nikolay Borisov wrote: > This is in preparation to refactor the giant loop in > __btrfs_run_delayed_refs. As a first step define a new function > which implements acquiring a reference to a btrfs_delayed_refs_head and > use it. No functional changes. > > S

Re: [PATCH RFC] btrfs: delayed-inode: Use spinlock to protect btrfs_inode::delayed_node

2018-09-21 Thread David Sterba
On Wed, Sep 19, 2018 at 02:59:58PM +0800, Qu Wenruo wrote: > In the following case, we could trigger a use-after-free bug: > > CPU0| CPU1 > - > btrfs_remove_delayed_node| btrf

btrfs send receive ERROR: chown failed: No such file or directory

2018-09-21 Thread Leonard Lausen
Hello! I observe the following issue with btrfs send | btrfs receive in a setup with 2 machines and 3 btrfs file-systems. All machines run Linux 4.18.9. Machine 1 runs btrfs-progs 4.17.1, machine 2 runs btrfs-progs 4.17 (via https://packages.debian.org/stretch-backports/btrfs-progs). 1) Machine 1

[PATCH] btrfs: use common helper instead of open coding a bit test

2018-09-21 Thread David Sterba
The helper does the same math and we take care about the special case when flags is 0 too. Signed-off-by: David Sterba --- fs/btrfs/volumes.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index 909c578506ee..26eb388db343 100644 --- a/

Re: [RFC PATCH v2 0/4] btrfs-progs: build distinct binaries for specific btrfs subcommands

2018-09-21 Thread Axel Burri
On 20/09/2018 10.32, Duncan wrote: > Axel Burri posted on Thu, 20 Sep 2018 00:02:22 +0200 as excerpted: > >> Now not everybody wants to install these with fscaps or setuid, but it >> might also make sense to provide "/usr/bin/btrfs-subvolume-{show,list}", >> as they now work for a regular user. Ha

Re: [PATCH v2 2/2] btrfs: relocation: Remove redundant tree level check

2018-09-21 Thread Qu Wenruo
On 2018/9/21 下午3:33, Nikolay Borisov wrote: > > > On 21.09.2018 10:20, Qu Wenruo wrote: >> Commit 581c1760415c ("btrfs: Validate child tree block's level and first >> key") has made tree block level check mandatory. >> >> So if tree block level doesn't match, we won't get a valid extent >> buf

Re: [PATCH v2 1/2] btrfs: relocation: Cleanup while() loop using rbtree_postorder_for_each_entry_safe()

2018-09-21 Thread Nikolay Borisov
On 21.09.2018 10:20, Qu Wenruo wrote: > And add one line comment explaining what we're doing for each loop. > > Signed-off-by: Qu Wenruo > --- Reviewed-by: Nikolay Borisov > changelog: > v2: > Use rbtree_postorder_for_each_entry_safe() to replace for() loop. > --- > fs/btrfs/relocation.c

Re: [PATCH v2 2/2] btrfs: relocation: Remove redundant tree level check

2018-09-21 Thread Nikolay Borisov
On 21.09.2018 10:20, Qu Wenruo wrote: > Commit 581c1760415c ("btrfs: Validate child tree block's level and first > key") has made tree block level check mandatory. > > So if tree block level doesn't match, we won't get a valid extent > buffer. > The extra WARN_ON() check can be removed complete

[PATCH v2 2/2] btrfs: relocation: Remove redundant tree level check

2018-09-21 Thread Qu Wenruo
Commit 581c1760415c ("btrfs: Validate child tree block's level and first key") has made tree block level check mandatory. So if tree block level doesn't match, we won't get a valid extent buffer. The extra WARN_ON() check can be removed completely. Signed-off-by: Qu Wenruo --- Changelog: v2: A

[PATCH v2 1/2] btrfs: relocation: Cleanup while() loop using rbtree_postorder_for_each_entry_safe()

2018-09-21 Thread Qu Wenruo
And add one line comment explaining what we're doing for each loop. Signed-off-by: Qu Wenruo --- changelog: v2: Use rbtree_postorder_for_each_entry_safe() to replace for() loop. --- fs/btrfs/relocation.c | 24 +--- 1 file changed, 9 insertions(+), 15 deletions(-) diff --gi