Re: [PATCH 00/10] btrfs: Support for DAX devices

2018-12-05 Thread Jeff Mahoney
| 29 fs/btrfs/inode.c| 54 + fs/btrfs/ioctl.c|5 fs/btrfs/super.c| 15 ++ fs/dax.c| 35 -- include/linux/dax.h | 16 ++ 9 files changed, 430 insertions(+), 45 deletions(-) -- Jeff Mahoney SUSE Labs

Re: [PATCH 00/10] btrfs: Support for DAX devices

2018-12-05 Thread Jeff Mahoney
penalty. The idea with DAX mmap is that the file system manages the namespace, space allocation, and permissions. Otherwise we stay out of the way. -Jeff -- Jeff Mahoney SUSE Labs

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 po

Re: [COMMAND HANGS] The command 'btrfs subvolume sync -s 2 xyz' can hangs.

2018-08-09 Thread Jeff Mahoney
> - After some time the kernel reports an error on the filesystem. > (error that existed before the command was launched.) > - The filesystem goes in read-only mode. > - The command hangs. Can you provide the output of 'dmesg' and the contents of /proc//stack where is the pid of the btrf

Re: [PATCH] btrfs: Fix a C compliance issue

2018-06-20 Thread Jeff Mahoney
s", crc32c_impl()); #ifdef CONFIG_BTRFS_DEBUG - ", debug=on" + pr_cont(", debug=on"); #endif #ifdef CONFIG_BTRFS_ASSERT - ", assert=on" + pr_cont(", assert=on"); #endif #ifdef CONFIG_BTRFS_FS_CHEC

Re: [PATCH 1/3] btrfs: Remove fs_info argument from __btrfs_inc_extent_ref

2018-06-19 Thread Jeff Mahoney
on taking only a trans handle when one is required and both a trans and fs_info when it's optional, it'll make the code clearer. This cleanup can percolate up the stack to cover pretty much all of delayed refs. Reviewed-by: Jeff Mahoney > Signed-off-by: Nikolay Borisov > --- > fs/btrfs/

Re: [PATCH] btrfs: Document __btrfs_inc_extent_ref

2018-06-14 Thread Jeff Mahoney
* tree of the parent block. > As mentioned above, it holds the level of the tree that contains the block. The parent can be looked up indirectly by taking this level and adding 1 until we hit the level of the root node. > + * @offset: For metadata extents this is always

Re: [PATCH RFC] btrfs: scrub: Don't use inode pages for device replace

2018-05-31 Thread Jeff Mahoney
physical_for_dev_replace, page); > @@ -4651,6 +4678,19 @@ static int copy_nocow_pages_for_inode(u64 inum, u64 > offset, u64 root, > inode_unlock(inode); > iput(inode); > return ret; > + > +fallback: > + inode_unlock(inode); > + iput(inode); > + > + ret = scrub_pages(nocow_ctx->sctx, nocow_ctx->logical, > + nocow_ctx->len, nocow_ctx->fb_physical, > + nocow_ctx->fb_dev, BTRFS_EXTENT_FLAG_DATA, > + nocow_ctx->fb_gen, nocow_ctx->mirror_num, > + NULL, 0, physical_for_dev_replace); > + if (!ret) > + ret = COPY_COMPLETE; > + return ret; > } > > static int write_page_nocow(struct scrub_ctx *sctx, > -- Jeff Mahoney SUSE Labs signature.asc Description: OpenPGP digital signature

Re: [PATCH v2 0/3] btrfs: add read mirror policy

2018-05-17 Thread Jeff Mahoney
btrfs_listxattr could get interesting, though I suppose we could simplify it by only allowing the per-subvolume and fs-global operations on root inodes. -Jeff -- Jeff Mahoney SUSE Labs signature.asc Description: OpenPGP digital signature

Re: [PATCH v2 0/3] btrfs: add read mirror policy

2018-05-17 Thread Jeff Mahoney
each mount? Properties could work, but there's more discussion needed there. Personally, I like the property idea since it could conceivably be used on a per-file basis. -Jeff -- Jeff Mahoney SUSE Labs signature.asc Description: OpenPGP digital signature

Re: [PATCH] btrfs: qgroup: Search commit root for rescan to avoid missing extent

2018-05-11 Thread Jeff Mahoney
d btrfs_qgroup_rescan_worker(struct > btrfs_work *work) > path = btrfs_alloc_path(); > if (!path) > goto out; > + /* > + * Rescan should only search for commit root, and any later difference > + * should be recorded by qgroup > + */

Re: [PATCH] btrfs: qgroup: Finish rescan when hit the last leaf of extent tree

2018-05-11 Thread Jeff Mahoney
gt; + * we want to commit the transaction if everything went well. > + * To make the live accounting work in this phase, we set our > + * scan progress pointer such that every real extent objectid > + * will be smaller. > + */ > + fs_info->qgroup_rescan_progress.objectid = (u64)-1; > + btrfs_release_path(path); > + mutex_unlock(_info->qgroup_rescan_lock); > + return 1; > } > > static void btrfs_qgroup_rescan_worker(struct btrfs_work *work) > -- Jeff Mahoney SUSE Labs signature.asc Description: OpenPGP digital signature

Re: [PATCH] btrfs: push relocation recovery into a helper thread

2018-05-10 Thread Jeff Mahoney
On 4/17/18 2:45 PM, Jeff Mahoney wrote: > On a file system with many snapshots and qgroups enabled, an interrupted > balance can end up taking a long time to mount due to recovering the > relocations during mount. It does this in the task performing the mount, > which can't be interru

Re: [PATCH 1/3] btrfs: qgroups, fix rescan worker running races

2018-05-10 Thread Jeff Mahoney
On 5/2/18 5:11 PM, je...@suse.com wrote: > From: Jeff Mahoney <je...@suse.com> > > Commit 8d9eddad194 (Btrfs: fix qgroup rescan worker initialization) > fixed the issue with BTRFS_IOC_QUOTA_RESCAN_WAIT being racy, but > ended up reintroducing the hang-on-unmount bug that the

Re: [PATCH 1/3] btrfs: qgroups, fix rescan worker running races

2018-05-10 Thread Jeff Mahoney
On 5/2/18 5:11 PM, je...@suse.com wrote: > From: Jeff Mahoney <je...@suse.com> > > Commit 8d9eddad194 (Btrfs: fix qgroup rescan worker initialization) > fixed the issue with BTRFS_IOC_QUOTA_RESCAN_WAIT being racy, but > ended up reintroducing the hang-on-unmount bug that the

Re: [RFC][PATCH 0/76] vfs: 'views' for filesystems with more than one root

2018-05-08 Thread Jeff Mahoney
ds of superblocks to do what a single lock does now and for what benefit? >> It's far more efficient then to pull those fields we need for a >> subvolume namespace into their own structure. > > I'm not convinced yet - it still feels like it's the wrong layer to > be solving the multiple namespace per superblock problem It needs to be between the inode and the superblock. If there are multiple user-visible namespaces, each will still get the same underlying file system namespace. -Jeff -- Jeff Mahoney SUSE Labs signature.asc Description: OpenPGP digital signature

Re: [PATCH v3 0/3] btrfs: qgroup rescan races (part 1)

2018-05-04 Thread Jeff Mahoney
On 5/4/18 1:59 AM, Nikolay Borisov wrote: > > > On 4.05.2018 01:27, Jeff Mahoney wrote: >> On 5/3/18 2:23 AM, Nikolay Borisov wrote: >>> >>> >>> On 3.05.2018 00:11, je...@suse.com wrote: >>>> From: Jeff Mahoney <je...@suse.com&g

Re: [PATCH v3 0/3] btrfs: qgroup rescan races (part 1)

2018-05-03 Thread Jeff Mahoney
On 5/3/18 2:23 AM, Nikolay Borisov wrote: > > > On 3.05.2018 00:11, je...@suse.com wrote: >> From: Jeff Mahoney <je...@suse.com> >> >> Hi Dave - >> >> Here's the updated patchset for the rescan races. This fixes the issue >> where we'd try to

Re: [PATCH 1/3] btrfs: qgroups, fix rescan worker running races

2018-05-03 Thread Jeff Mahoney
On 5/3/18 11:52 AM, Nikolay Borisov wrote: > > > On 3.05.2018 16:39, Jeff Mahoney wrote: >> On 5/3/18 3:24 AM, Nikolay Borisov wrote: >>> >>> >>> On 3.05.2018 00:11, je...@suse.com wrote: >>>> From: Jeff Mahoney <je...@suse.com> &

Re: [PATCH 1/3] btrfs: qgroups, fix rescan worker running races

2018-05-03 Thread Jeff Mahoney
On 5/3/18 3:24 AM, Nikolay Borisov wrote: > > > On 3.05.2018 00:11, je...@suse.com wrote: >> From: Jeff Mahoney <je...@suse.com> >> >> Commit 8d9eddad194 (Btrfs: fix qgroup rescan worker initialization) >> fixed the issue with BTRFS_IOC_QUOTA_

Re: [PATCH 1/3] btrfs: qgroups, fix rescan worker running races

2018-05-02 Thread Jeff Mahoney
On 5/2/18 9:15 AM, David Sterba wrote: > On Wed, May 02, 2018 at 12:29:28PM +0200, David Sterba wrote: >> On Thu, Apr 26, 2018 at 03:23:49PM -0400, je...@suse.com wrote: >>> From: Jeff Mahoney <je...@suse.com> >>> +static void queue_rescan_wor

Re: Strange behavior (possible bugs) in btrfs

2018-04-30 Thread Jeff Mahoney
> > Thanks, > Vijay > -- > To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in > the body of a message to majord...@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > -- Jeff Mahoney SUSE Labs -- To unsubscri

Re: [PATCH 1/3] btrfs: qgroups, fix rescan worker running races

2018-04-30 Thread Jeff Mahoney
On 4/30/18 2:20 AM, Qu Wenruo wrote: > > > On 2018年04月27日 03:23, je...@suse.com wrote: >> From: Jeff Mahoney <je...@suse.com> >> >> Commit d2c609b834d6 (Btrfs: fix qgroup rescan worker initialization) >> fixed the issue with BTRFS_IOC_QUOTA_RESCAN_WAIT be

Re: [PATCH 3/3] btrfs-progs: build: use m4_flatten instead of m4_chomp

2018-04-29 Thread Jeff Mahoney
On 4/29/18 6:13 AM, David Sterba wrote: > On Fri, Apr 27, 2018 at 03:18:17PM -0400, Jeff Mahoney wrote: >> On 4/27/18 2:56 PM, je...@suse.com wrote: >>> From: Jeff Mahoney <je...@suse.com> >>> >>> Commit 2e1932e6a38 (btrfs-progs: build: simplify versi

Re: [PATCH 1/3] btrfs: qgroups, fix rescan worker running races

2018-04-27 Thread Jeff Mahoney
On 4/27/18 12:40 PM, David Sterba wrote: > On Fri, Apr 27, 2018 at 12:02:13PM -0400, Jeff Mahoney wrote: >>>> +static void queue_rescan_worker(struct btrfs_fs_info *fs_info) >>>> +{ >>> >>> And this had to be moved upwards as there was earlier use o

Re: [PATCH 3/3] btrfs-progs: build: use m4_flatten instead of m4_chomp

2018-04-27 Thread Jeff Mahoney
On 4/27/18 2:56 PM, je...@suse.com wrote: > From: Jeff Mahoney <je...@suse.com> > > Commit 2e1932e6a38 (btrfs-progs: build: simplify version tracking) > started m4_chomp to strip the newlines from the version file. m4_chomp > was introduced in autoconf 2.64 but SLE11 shi

[PATCH v2] btrfs: qgroup, don't try to insert status item after ENOMEM in rescan worker

2018-04-27 Thread Jeff Mahoney
If we fail to allocate memory for a path, don't bother trying to insert the qgroup status item. We haven't done anything yet and it'll fail also. Just print an error and be done with it. Signed-off-by: Jeff Mahoney <je...@suse.com> --- fs/btrfs/qgroup.c | 9 - 1 file chan

Re: [PATCH 3/3] btrfs: qgroup, don't try to insert status item after ENOMEM in rescan worker

2018-04-27 Thread Jeff Mahoney
On 4/27/18 11:44 AM, David Sterba wrote: > On Thu, Apr 26, 2018 at 11:39:50PM +0300, Nikolay Borisov wrote: >> On 26.04.2018 22:23, je...@suse.com wrote: >>> From: Jeff Mahoney <je...@suse.com> >>> >>> If we fail to allocate memory for a path, don't bot

Re: [PATCH 1/3] btrfs: qgroups, fix rescan worker running races

2018-04-27 Thread Jeff Mahoney
On 4/27/18 11:56 AM, David Sterba wrote: > On Thu, Apr 26, 2018 at 03:23:49PM -0400, je...@suse.com wrote: >> From: Jeff Mahoney <je...@suse.com> >> >> Commit d2c609b834d6 (Btrfs: fix qgroup rescan worker initialization) >> fixed the issue with BTRFS_IOC_QUOTA_RES

Re: [PATCH 1/3] btrfs: qgroups, fix rescan worker running races

2018-04-27 Thread Jeff Mahoney
On 4/27/18 4:48 AM, Filipe Manana wrote: > On Thu, Apr 26, 2018 at 8:23 PM, <je...@suse.com> wrote: >> From: Jeff Mahoney <je...@suse.com> >> >> Commit d2c609b834d6 (Btrfs: fix qgroup rescan worker initialization) >> fixed the issue with BTRFS_IOC_QUOTA_

Re: [PATCH] btrfs: push relocation recovery into a helper thread

2018-04-24 Thread Jeff Mahoney
On 4/23/18 5:43 PM, David Sterba wrote: > On Tue, Apr 17, 2018 at 02:45:33PM -0400, Jeff Mahoney wrote: >> On a file system with many snapshots and qgroups enabled, an interrupted >> balance can end up taking a long time to mount due to recovering the >> relocations d

[PATCH] btrfs: push relocation recovery into a helper thread

2018-04-17 Thread Jeff Mahoney
any new balance operations if it's running, and wait for it on umount and remounting read-only. This doesn't do anything to address the relocation recovery operation taking a long time but does allow the file system to mount. Signed-off-by: Jeff Mahoney <je...@suse.com> --- fs/btrfs/c

Re: [PATCH v2] btrfs: Validate child tree block's level and first key

2018-03-23 Thread Jeff Mahoney
>> >>> for (i = *level; i > 0; i--) { >>> + struct btrfs_key first_key; >>> + >>> eb = path->nodes[i]; >>> nritems = btrfs_header_nritems(eb); >>> while (path->slots[i] < nritems) { >>> @@ -2056,7 +2062,9 @@ int walk_down_reloc_tree(struct btrfs_root *root, >>> struct btrfs_path *path, >>> } >>> >>> bytenr = btrfs_node_blockptr(eb, path->slots[i]); >>> - eb = read_tree_block(fs_info, bytenr, ptr_gen); >>> + btrfs_node_key_to_cpu(eb, _key, path->slots[i]); >>> + eb = read_tree_block(fs_info, bytenr, ptr_gen, _key, >>> +i - 1); >>> if (IS_ERR(eb)) { >>> return PTR_ERR(eb); >>> } else if (!extent_buffer_uptodate(eb)) { >>> @@ -2714,6 +2722,8 @@ static int do_relocation(struct btrfs_trans_handle >>> *trans, >>> path->lowest_level = node->level + 1; >>> rc->backref_cache.path[node->level] = node; >>> list_for_each_entry(edge, >upper, list[LOWER]) { >>> + struct btrfs_key first_key; >>> + >>> cond_resched(); >>> >>> upper = edge->node[UPPER]; >>> @@ -2779,7 +2789,9 @@ static int do_relocation(struct btrfs_trans_handle >>> *trans, >>> >>> blocksize = root->fs_info->nodesize; >>> generation = btrfs_node_ptr_generation(upper->eb, slot); >>> - eb = read_tree_block(fs_info, bytenr, generation); >>> + btrfs_node_key_to_cpu(upper->eb, _key, slot); >>> + eb = read_tree_block(fs_info, bytenr, generation, _key, >>> +upper->level - 1); >>> if (IS_ERR(eb)) { >>> err = PTR_ERR(eb); >>> goto next; >>> @@ -2944,7 +2956,8 @@ static int get_tree_block_key(struct btrfs_fs_info >>> *fs_info, >>> struct extent_buffer *eb; >>> >>> BUG_ON(block->key_ready); >>> - eb = read_tree_block(fs_info, block->bytenr, block->key.offset); >>> + eb = read_tree_block(fs_info, block->bytenr, block->key.offset, NULL, >>> +0); >>> if (IS_ERR(eb)) { >>> return PTR_ERR(eb); >>> } else if (!extent_buffer_uptodate(eb)) { >>> diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c >>> index 434457794c27..b98a1801b406 100644 >>> --- a/fs/btrfs/tree-log.c >>> +++ b/fs/btrfs/tree-log.c >>> @@ -304,7 +304,7 @@ static int process_one_buffer(struct btrfs_root *log, >>> * pin down any logged extents, so we have to read the block. >>> */ >>> if (btrfs_fs_incompat(fs_info, MIXED_GROUPS)) { >>> - ret = btrfs_read_buffer(eb, gen); >>> + ret = btrfs_read_buffer(eb, gen, NULL, 0); >>> if (ret) >>> return ret; >>> } >>> @@ -2420,7 +2420,7 @@ static int replay_one_buffer(struct btrfs_root *log, >>> struct extent_buffer *eb, >>> int i; >>> int ret; >>> >>> - ret = btrfs_read_buffer(eb, gen); >>> + ret = btrfs_read_buffer(eb, gen, NULL, 0); >>> if (ret) >>> return ret; >>> >>> @@ -2537,6 +2537,8 @@ static noinline int walk_down_log_tree(struct >>> btrfs_trans_handle *trans, >>> WARN_ON(*level >= BTRFS_MAX_LEVEL); >>> >>> while (*level > 0) { >>> + struct btrfs_key first_key; >>> + >>> WARN_ON(*level < 0); >>> WARN_ON(*level >= BTRFS_MAX_LEVEL); >>> cur = path->nodes[*level]; >>> @@ -2549,6 +2551,7 @@ static noinline int walk_down_log_tree(struct >>> btrfs_trans_handle *trans, >>> >>> bytenr = btrfs_node_blockptr(cur, path->slots[*level]); >>> ptr_gen = btrfs_node_ptr_generation(cur, path->slots[*level]); >>> + btrfs_node_key_to_cpu(cur, _key, path->slots[*level]); >>> blocksize = fs_info->nodesize; >>> >>> parent = path->nodes[*level]; >>> @@ -2567,7 +2570,8 @@ static noinline int walk_down_log_tree(struct >>> btrfs_trans_handle *trans, >>> >>> path->slots[*level]++; >>> if (wc->free) { >>> - ret = btrfs_read_buffer(next, ptr_gen); >>> + ret = btrfs_read_buffer(next, ptr_gen, >>> + _key, *level - 1); >>> if (ret) { >>> free_extent_buffer(next); >>> return ret; >>> @@ -2597,7 +2601,7 @@ static noinline int walk_down_log_tree(struct >>> btrfs_trans_handle *trans, >>> free_extent_buffer(next); >>> continue; >>> } >>> - ret = btrfs_read_buffer(next, ptr_gen); >>> + ret = btrfs_read_buffer(next, ptr_gen, _key, *level - 1); >>> if (ret) { >>> free_extent_buffer(next); >>> return ret; >>> >> -- >> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in >> the body of a message to majord...@vger.kernel.org >> More majordomo info at http://vger.kernel.org/majordomo-info.html >> > -- Jeff Mahoney SUSE Labs signature.asc Description: OpenPGP digital signature

Re: [PATCH] btrfs: fix lockdep splat in btrfs_alloc_subvolume_writers

2018-03-19 Thread Jeff Mahoney
On 3/19/18 2:08 PM, David Sterba wrote: > On Mon, Mar 19, 2018 at 01:52:05PM -0400, Jeff Mahoney wrote: >> On 3/16/18 4:12 PM, David Sterba wrote: >>> On Fri, Mar 16, 2018 at 02:36:27PM -0400, je...@suse.com wrote: >>>> From: Jeff Mahoney <je...@suse.com> >

Re: [PATCH] btrfs: fix lockdep splat in btrfs_alloc_subvolume_writers

2018-03-19 Thread Jeff Mahoney
On 3/16/18 4:12 PM, David Sterba wrote: > On Fri, Mar 16, 2018 at 02:36:27PM -0400, je...@suse.com wrote: >> From: Jeff Mahoney <je...@suse.com> >> >> While running btrfs/011, I hit the following lockdep splat. >> >> This is the impo

Re: [PATCH] btrfs: fix lockdep splat in btrfs_alloc_subvolume_writers

2018-03-16 Thread Jeff Mahoney
On 3/16/18 4:12 PM, David Sterba wrote: > On Fri, Mar 16, 2018 at 02:36:27PM -0400, je...@suse.com wrote: >> From: Jeff Mahoney <je...@suse.com> >> >> While running btrfs/011, I hit the following lockdep splat. >> >> This is the impo

Re: [PATCH] btrfs: fix lockdep splat in btrfs_alloc_subvolume_writers

2018-03-16 Thread Jeff Mahoney
On 3/16/18 2:48 PM, Nikolay Borisov wrote: > > > On 16.03.2018 20:36, je...@suse.com wrote: >> From: Jeff Mahoney <je...@suse.com> >> >> While running btrfs/011, I hit the following lockdep splat. >> >> This is the important bit: >>pcpu_allo

Re: [PATCH 13/20] btrfs-progs: use cmd_struct as command entry point

2018-03-11 Thread Jeff Mahoney
tatic DEFINE_SIMPLE_COMMAND(filesystem_defrag, "defrag"); "defragment" -Jeff -- Jeff Mahoney SUSE Labs signature.asc Description: OpenPGP digital signature

Re: [PATCH 13/20] btrfs-progs: use cmd_struct as command entry point

2018-03-11 Thread Jeff Mahoney
On 3/7/18 9:40 PM, je...@suse.com wrote: > From: Jeff Mahoney <je...@suse.com> > diff --git a/cmds-inspect.c b/cmds-inspect.c > index afd7fe48..12f200b3 100644 > --- a/cmds-inspect.c > +++ b/cmds-inspect.c > @@ -625,33 +629,27 @@ static int cmd_inspect_min_dev_size(int argc

Re: [PATCH 08/20] btrfs-progs: qgroups: introduce btrfs_qgroup_query

2018-03-08 Thread Jeff Mahoney
On 3/8/18 12:54 AM, Qu Wenruo wrote: > > > On 2018年03月08日 10:40, je...@suse.com wrote: >> From: Jeff Mahoney <je...@suse.com> >> >> The only mechanism we have in the progs for searching qgroups is to load >> all of them and filter the results. This wo

Re: [PATCH 06/20] btrfs-progs: qgroups: add pathname to show output

2018-03-08 Thread Jeff Mahoney
On 3/8/18 12:33 AM, Qu Wenruo wrote: > > > On 2018年03月08日 10:40, je...@suse.com wrote: >> From: Jeff Mahoney <je...@suse.com> >> >> The btrfs qgroup show command currently only exports qgroup IDs, >> forcing the user to resolve which subvolume each corresp

Re: [PATCH 3/8] btrfs-progs: constify pathnames passed as arguments

2018-03-07 Thread Jeff Mahoney
On 3/7/18 3:17 AM, Nikolay Borisov wrote: > > > On 2.03.2018 20:46, je...@suse.com wrote: >> From: Jeff Mahoney <je...@suse.com> >> >> It's unlikely we're going to modify a pathname argument, so codify that >> and use const. >> >> Signed-off

Re: [PATCH 6/8] btrfs-progs: qgroups: introduce btrfs_qgroup_query

2018-03-07 Thread Jeff Mahoney
On 3/7/18 3:02 AM, Misono, Tomohiro wrote: > On 2018/03/03 3:47, je...@suse.com wrote: >> From: Jeff Mahoney <je...@suse.com> >> >> The only mechanism we have in the progs for searching qgroups is to load >> all of them and filter the results. This works fo

Re: [PATCH 7/8] btrfs-progs: subvolume: add quota info to btrfs sub show

2018-03-07 Thread Jeff Mahoney
On 3/7/18 1:09 AM, Qu Wenruo wrote: > > > On 2018年03月03日 02:47, je...@suse.com wrote: >> From: Jeff Mahoney <je...@suse.com> >> >> This patch reports on the first-level qgroup, if any, associated with >> a particular subvolume. It displays the usage

Re: [PATCH 6/8] btrfs-progs: qgroups: introduce btrfs_qgroup_query

2018-03-07 Thread Jeff Mahoney
ular key comparison and offset doesn't get evaluated if the types aren't equal. That works fine when doing tree insertion or searches for a single key but is wrong for searching for a range. I have a TREE_SEARCH_V3 lying around somewhere to address this ridiculous behavior and should probably finish it up at some point. This hasn't mattered for __qgroup_search until now since it hasn't used anything other than -1 for the offset and objectid so I'll just add a filter there. -Jeff -- Jeff Mahoney SUSE Labs signature.asc Description: OpenPGP digital signature

Re: [PATCH 4/8] btrfs-progs: qgroups: add pathname to show output

2018-03-07 Thread Jeff Mahoney
ruct btrfs_qgroup *qgroup_tree_search(struct >> qgroup_lookup *root_tree, >> * Return the pointer to the btrfs_qgroup if found or if inserted >> successfully. >> * Return ERR_PTR if any error occurred. >> */ >> -static struct btrfs_qgroup *get_or_add_qgroup( >

Re: [PATCH 8/8] btrfs-progs: qgroups: export qgroups usage information as JSON

2018-03-07 Thread Jeff Mahoney
t. I'll replace the magic number with a define though. > BTW, the result is just 22. It's a worst-case. We're using %llu, so 42 is the length of two 64-bit numbers in base ten, plus the slash and nul terminator. In practice we won't hit the limit, but it doesn't hurt. Thanks for the review. -Jeff -- Jeff Mahoney SUSE Labs signature.asc Description: OpenPGP digital signature

Re: [PATCH 1/8] btrfs-progs: quota: Add -W option to rescan to wait without starting rescan

2018-03-02 Thread Jeff Mahoney
On 3/2/18 1:59 PM, Nikolay Borisov wrote: > > > On 2.03.2018 20:46, je...@suse.com wrote: >> From: Jeff Mahoney <je...@suse.com> >> @@ -135,8 +141,9 @@ static int cmd_quota_rescan(int argc, char **argv) >> } >> } >> &

Re: [PATCH 0/8] btrfs-progs: qgroups usability

2018-03-02 Thread Jeff Mahoney
On 3/2/18 1:39 PM, je...@suse.com wrote: > From: Jeff Mahoney <je...@suse.com> > > Hi all - > > The following series addresses some usability issues with the qgroups UI. > > 1) Adds -W option so we can wait on a rescan completing without starting one. > 2) Add

Re: [PATCH v2 10/10] btrfs: qgroup: Use independent and accurate per inode qgroup rsv

2018-02-23 Thread Jeff Mahoney
On 2/22/18 6:34 PM, Qu Wenruo wrote: > > > On 2018年02月23日 06:44, Jeff Mahoney wrote: >> On 12/22/17 1:18 AM, Qu Wenruo wrote: >>> Unlike reservation calculation used in inode rsv for metadata, qgroup >>> doesn't really need to care things like csum size or ex

Re: [PATCH v2 10/10] btrfs: qgroup: Use independent and accurate per inode qgroup rsv

2018-02-22 Thread Jeff Mahoney
void > btrfs_calculate_inode_block_rsv_size(struct btrfs_fs_info *fs_info, >inode->csum_bytes); > reserve_size += btrfs_calc_trans_metadata_size(fs_info, > csum_leaves); > + /* &

Re: [PATCH] btrfs: qgroups, properly handle no reservations

2018-02-21 Thread Jeff Mahoney
On 2/21/18 8:36 PM, Qu Wenruo wrote: > > > On 2018年02月22日 04:19, je...@suse.com wrote: >> From: Jeff Mahoney <je...@suse.com> >> >> There are several places where we call btrfs_qgroup_reserve_meta and >> assume that a return value of 0 means that the rese

Re: [PATCH] btrfs: btrfs_evict_inode must clear all inodes

2018-01-29 Thread Jeff Mahoney
On 1/29/18 2:58 PM, Liu Bo wrote: > On Mon, Jan 29, 2018 at 11:46:28AM -0500, Jeff Mahoney wrote: >> btrfs_evict_inode must clear all inodes or we'll hit a BUG_ON in evict(). >> >> Fixes: 3d48d9810de (btrfs: Handle uninitialised inode eviction) >> Cc: Nikolay Boriso

[PATCH] btrfs: btrfs_evict_inode must clear all inodes

2018-01-29 Thread Jeff Mahoney
btrfs_evict_inode must clear all inodes or we'll hit a BUG_ON in evict(). Fixes: 3d48d9810de (btrfs: Handle uninitialised inode eviction) Cc: Nikolay Borisov <nbori...@suse.com> Cc: <sta...@vger.kernel.org> # v4.8+ Signed-off-by: Jeff Mahoney <je...@suse.com> --- fs/btrfs/i

Re: bug? fstrim only trims unallocated space, not unused in bg's

2017-11-20 Thread Jeff Mahoney
On 11/20/17 11:04 PM, Chris Murphy wrote: > On Mon, Nov 20, 2017 at 6:46 PM, Jeff Mahoney <je...@suse.com> wrote: >> On 11/20/17 5:59 PM, Chris Murphy wrote: >>> On Mon, Nov 20, 2017 at 1:40 PM, Jeff Mahoney <je...@suse.com> wrote: >>>> On 11/20/17 3:01 P

Re: bug? fstrim only trims unallocated space, not unused in bg's

2017-11-20 Thread Jeff Mahoney
On 11/20/17 5:59 PM, Chris Murphy wrote: > On Mon, Nov 20, 2017 at 1:40 PM, Jeff Mahoney <je...@suse.com> wrote: >> On 11/20/17 3:01 PM, Jeff Mahoney wrote: >>> On 11/20/17 3:00 PM, Jeff Mahoney wrote: >>>> On 11/19/17 4:38 PM, Chris Murphy wrote: >>&g

Re: bug? fstrim only trims unallocated space, not unused in bg's

2017-11-20 Thread Jeff Mahoney
On 11/20/17 3:01 PM, Jeff Mahoney wrote: > On 11/20/17 3:00 PM, Jeff Mahoney wrote: >> On 11/19/17 4:38 PM, Chris Murphy wrote: >>> On Sat, Nov 18, 2017 at 11:27 PM, Andrei Borzenkov <arvidj...@gmail.com> >>> wrote: >>>> 19.11.2017 09:17, Chris Murp

Re: bug? fstrim only trims unallocated space, not unused in bg's

2017-11-20 Thread Jeff Mahoney
On 11/20/17 3:00 PM, Jeff Mahoney wrote: > On 11/19/17 4:38 PM, Chris Murphy wrote: >> On Sat, Nov 18, 2017 at 11:27 PM, Andrei Borzenkov <arvidj...@gmail.com> >> wrote: >>> 19.11.2017 09:17, Chris Murphy пишет: >>>> fstrim should trim

Re: [PATCH 1/6] btrfs: qgroup: Skeleton to support separate qgroup reservation type

2017-10-24 Thread Jeff Mahoney
On 10/24/17 8:29 AM, Jeff Mahoney wrote: > On 10/24/17 7:51 AM, Qu Wenruo wrote: >> >> >> On 2017年10月24日 19:00, Nikolay Borisov wrote: >>> nit: Why not BTRFS_QGROUP_RSV_TYPES_MAX = 2; >> >> My original plan is just as the same as yours. >> >&

Re: [PATCH 1/6] btrfs: qgroup: Skeleton to support separate qgroup reservation type

2017-10-24 Thread Jeff Mahoney
truct btrfs_qgroup { >>> * reservation tracking >>> */ >>> u64 reserved; >>> + struct btrfs_qgroup_rsv rsv; >>> >>> /* >>> * lists >>> @@ -228,12 +249,14 @@ int btrfs_qgroup_inherit(struct btrfs_trans_handle >>> *trans, >>> struct btrfs_fs_info *fs_info, u64 srcid, u64 objectid, >>> struct btrfs_qgroup_inherit *inherit); >>> void btrfs_qgroup_free_refroot(struct btrfs_fs_info *fs_info, >>> - u64 ref_root, u64 num_bytes); >>> + u64 ref_root, u64 num_bytes, >>> + enum btrfs_qgroup_rsv_type type); >>> static inline void btrfs_qgroup_free_delayed_ref(struct btrfs_fs_info >>> *fs_info, >>> u64 ref_root, u64 num_bytes) >>> { >>> trace_btrfs_qgroup_free_delayed_ref(fs_info, ref_root, num_bytes); >>> - btrfs_qgroup_free_refroot(fs_info, ref_root, num_bytes); >>> + btrfs_qgroup_free_refroot(fs_info, ref_root, num_bytes, >>> + BTRFS_QGROUP_RSV_DATA); >>> } >>> >>> #ifdef CONFIG_BTRFS_FS_RUN_SANITY_TESTS >>> >> -- >> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in >> the body of a message to majord...@vger.kernel.org >> More majordomo info at http://vger.kernel.org/majordomo-info.html >> > -- Jeff Mahoney SUSE Labs signature.asc Description: OpenPGP digital signature

Re: reproducable oops in btrfs/130 with latests mainline

2017-10-17 Thread Jeff Mahoney
; https://bugs.launchpad.net/bugs/1717443 >> -- >> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in >> the body of a message to majord...@vger.kernel.org >> More majordomo info at http://vger.kernel.org/majordomo-info.html >> > -- Jeff Mahoney SUSE Labs signature.asc Description: OpenPGP digital signature

Re: Fatal failure, btrfs raid with duplicated metadata

2017-10-11 Thread Jeff Mahoney
On 10/11/17 2:20 PM, Ian Kumlien wrote: > > > On Wed, Oct 11, 2017 at 2:10 PM Jeff Mahoney <je...@suse.com > <mailto:je...@suse.com>> wrote: > > On 10/11/17 12:41 PM, Ian Kumlien wrote: > > [--8<--]  > > > Eventually the fi

Re: Fatal failure, btrfs raid with duplicated metadata

2017-10-11 Thread Jeff Mahoney
le spinning disks to get a little bit more resiliency in the face of bad sectors. The check error above means that it wasn't able to map a logical address to a physical address. Typically that means that the mapping was lost. -Jeff -- Jeff Mahoney SUSE Labs signature.asc Description: OpenPGP digital signature

Re: [RFC v3 0/2] vfs / btrfs: add support for ustat()

2017-08-23 Thread Jeff Mahoney
just work. We do. We did then too. But what doesn't work is a user doing stat() and then using the dev_t to call ustat(). -Jeff -- Jeff Mahoney SUSE Labs signature.asc Description: OpenPGP digital signature

Re: [PATCH 3/5] btrfs: Use common error handling code in btrfs_update_root()

2017-08-21 Thread Jeff Mahoney
ptr = btrfs_item_ptr_offset(l, slot); > @@ -204,6 +196,9 @@ int btrfs_update_root(struct btrfs_trans_handle *trans, > struct btrfs_root > out: > btrfs_free_path(path); > return ret; > +abort_transaction: > + btrfs_abort_transaction(trans, ret); > + goto out; > } > > int btrfs_insert_root(struct btrfs_trans_handle *trans, struct btrfs_root > *root, > -- Jeff Mahoney SUSE Labs signature.asc Description: OpenPGP digital signature

Re: [PATCH 4/5] btrfs: Use common error handling code in update_ref_path()

2017-08-21 Thread Jeff Mahoney
o free_path; > + > ret = fs_path_add(new_path, ref->name, ref->name_len); > if (ret < 0) { > +free_path: > fs_path_free(new_path); > return ret; > } > -- Jeff Mahoney SUSE Labs signature.asc Description: OpenPGP digital signature

Re: [PATCH 2/5] btrfs: Use common error handling code in __btrfs_free_extent()

2017-08-21 Thread Jeff Mahoney
if (ret) > + goto abort_transaction; > > ret = update_block_group(trans, info, bytenr, num_bytes, 0); > - if (ret) { > - btrfs_abort_transaction(trans, ret); > - goto out; > - } > + if (ret) > + goto abort_transaction; > } > btrfs_release_path(path); > > out: > btrfs_free_path(path); > return ret; > +abort_transaction: > + btrfs_abort_transaction(trans, ret); > + goto out; > } > > /* > -- Jeff Mahoney SUSE Labs signature.asc Description: OpenPGP digital signature

Re: [PATCH 5/5] btrfs: Use common error handling code in btrfs_mark_extent_written()

2017-08-21 Thread Jeff Mahoney
uffer_dirty(leaf); > > ret = btrfs_del_items(trans, root, path, del_slot, del_nr); > - if (ret < 0) { > - btrfs_abort_transaction(trans, ret); > - goto out; > - } > + if (ret < 0) > + goto abort_transaction; > } > out: > btrfs_free_path(path); > return 0; > +e_inval: > + ret = -EINVAL; > +abort_transaction: > + btrfs_abort_transaction(trans, ret); > + goto out; > } > > /* > -- Jeff Mahoney SUSE Labs signature.asc Description: OpenPGP digital signature

[PATCH v2] btrfs: pass fs_info to btrfs_del_root instead of tree_root

2017-08-17 Thread Jeff Mahoney
btrfs_del_roots always uses the tree_root. Let's pass fs_info instead. Signed-off-by: Jeff Mahoney <je...@suse.com> --- fs/btrfs/ctree.h | 4 ++-- fs/btrfs/extent-tree.c | 2 +- fs/btrfs/free-space-tree.c | 2 +- fs/btrfs/qgroup.c | 3 +-- fs/btrfs/root-tree.c

Re: [PATCH] btrfs: pass fs_info to routines that always take tree_root

2017-08-17 Thread Jeff Mahoney
On 8/2/17 3:54 PM, je...@suse.com wrote: > From: Jeff Mahoney <je...@suse.com> > > btrfs_find_root and btrfs_del_root always use the tree_root. Let's pass > fs_info instead. This one is broken. btrfs_read_fs_root is called during log tree recovery with the log_root_tree. I'

Re: btrfs-progs-v4.12: cross compiling

2017-08-15 Thread Jeff Mahoney
cripted implementation. > > The workflow is simple: > - copy kernel mktables.c changes to btrfs-progs mktables.c > - compile mktables > - run 'make kernel-lib/tables.c' Can't this happen as part of a make dist (that we don't do right now)? > - commit the changes to git ... and anyone using the git repo directly can sort out how to build it? -Jeff -- Jeff Mahoney SUSE Labs signature.asc Description: OpenPGP digital signature

Re: Btrfs umount hang

2017-08-09 Thread Jeff Mahoney
ably why we haven't seen this issue sooner. There's potential for this to happen whenever two threads are modifying the tree at once and one needs to find a free extent. I'll need to think a bit on how to fix it. -Jeff > Best regards, > Angel > > On Mon, Aug 7, 2017 at 9:10 PM, Jeff Mahone

Re: Btrfs umount hang

2017-08-07 Thread Jeff Mahoney
On 8/7/17 1:19 PM, Jeff Mahoney wrote: > On 8/7/17 10:12 AM, Angel Shtilianov wrote: >> Hi there, >> I'm investigating sporadic hanging during btrfs umount. The FS is >> contained in a loop mounted file. >> I have no reproduction scenario and the issue may happen on

Re: Btrfs umount hang

2017-08-07 Thread Jeff Mahoney
> Do you have any ideas ? Hi Angel - In your log, it says lockdep is disabled. What tripped it earlier? Lockdep really should be catching locking deadlocks in situations like this, if that's really the underlying cause. -Jeff -- Jeff Mahoney SUSE Labs signature.asc Description: OpenPGP digital signature

Re: [PATCH 4/5] btrfs-progs: tests: fix typo in convert-tests/008-readonly-image

2017-07-31 Thread Jeff Mahoney
On 7/27/17 9:27 PM, Qu Wenruo wrote: > > > On 2017年07月27日 23:47, je...@suse.com wrote: >> From: Jeff Mahoney <je...@suse.com> >> >> The dd in convert-tests/008-readonly-image is expected to fail, so >> there being a typo in the file name has g

Re: [PATCH 1/3] btrfs-progs: convert: properly handle reserved ranges while iterating files

2017-07-27 Thread Jeff Mahoney
On 7/27/17 12:38 PM, Jeff Mahoney wrote: > On 7/26/17 9:35 PM, Qu Wenruo wrote: >> >> >> On 2017年07月26日 04:54, je...@suse.com wrote: >>> From: Jeff Mahoney <je...@suse.com> >>> >>> Commit 522ef705e38 (btrfs-progs: convert: Introduce functio

Re: [PATCH 1/3] btrfs-progs: convert: properly handle reserved ranges while iterating files

2017-07-27 Thread Jeff Mahoney
On 7/26/17 9:35 PM, Qu Wenruo wrote: > > > On 2017年07月26日 04:54, je...@suse.com wrote: >> From: Jeff Mahoney <je...@suse.com> >> >> Commit 522ef705e38 (btrfs-progs: convert: Introduce function to calculate >> the available space) changed how we handle migra

Re: [PATCH 5/7] btrfs-progs: backref: add list_first_pref helper

2017-07-26 Thread Jeff Mahoney
On 7/26/17 9:22 AM, Jeff Mahoney wrote: > On 7/26/17 3:08 AM, Nikolay Borisov wrote: >> >> >> On 25.07.2017 23:51, je...@suse.com wrote: >>> From: Jeff Mahoney <je...@suse.com> >>> >>> --- >>> backref.c | 11 +++ >>

Re: [PATCH 5/7] btrfs-progs: backref: add list_first_pref helper

2017-07-26 Thread Jeff Mahoney
On 7/26/17 3:08 AM, Nikolay Borisov wrote: > > > On 25.07.2017 23:51, je...@suse.com wrote: >> From: Jeff Mahoney <je...@suse.com> >> >> --- >> backref.c | 11 +++ >> 1 file changed, 7 insertions(+), 4 deletions(-) >> >> dif

Re: [PATCH 3/7] btrfs-progs: extent-cache: actually cache extent buffers

2017-07-26 Thread Jeff Mahoney
On 7/26/17 3:00 AM, Nikolay Borisov wrote: > > > On 25.07.2017 23:51, je...@suse.com wrote: >> From: Jeff Mahoney <je...@suse.com> >> >> We have the infrastructure to cache extent buffers but we don't actually >> do the caching. As soon as the last referen

Re: [PATCH 3/3] btrfs-progs: convert: add support for converting reiserfs

2017-07-25 Thread Jeff Mahoney
On 7/25/17 4:54 PM, je...@suse.com wrote: > From: Jeff Mahoney <je...@suse.com> > > This patch adds support to convert reiserfs file systems in-place to btrfs. > > It will convert extended attribute files to btrfs extended attributes, > translate ACLs, coalesce tails

[PATCH] btrfs: fix lockup in find_free_extent with read-only block groups

2017-07-19 Thread Jeff Mahoney
BTRFS_CACHE_ERROR is considered a "done" state and we won't re-set have_caching_bg again. Many thanks to Stephan Kulow <co...@suse.de> for his excellent help in the testing process. Signed-off-by: Jeff Mahoney <je...@suse.com> --- fs/btrfs/extent-tree.c |7 +-- 1 fil

Re: [PATCH v2 1/2] btrfs: account for pinned bytes in should_alloc_chunk

2017-06-29 Thread Jeff Mahoney
On 6/29/17 3:21 PM, Omar Sandoval wrote: > On Thu, Jun 22, 2017 at 09:51:47AM -0400, je...@suse.com wrote: >> From: Jeff Mahoney <je...@suse.com> >> >> In a heavy write scenario, we can end up with a large number of pinned bytes. >> This can translate into (very

Re: Lock between userspace and btrfs-cleaner on extent_buffer

2017-06-29 Thread Jeff Mahoney
On 6/29/17 2:46 PM, Sargun Dhillon wrote: > On Thu, Jun 29, 2017 at 11:42 AM, Jeff Mahoney <je...@suse.com> wrote: >> On 6/28/17 6:02 PM, Sargun Dhillon wrote: >>> On Wed, Jun 28, 2017 at 2:55 PM, Jeff Mahoney <je...@suse.com> wrote: >>>> On 6/27/17 5:12

Re: Lock between userspace and btrfs-cleaner on extent_buffer

2017-06-29 Thread Jeff Mahoney
On 6/28/17 6:02 PM, Sargun Dhillon wrote: > On Wed, Jun 28, 2017 at 2:55 PM, Jeff Mahoney <je...@suse.com> wrote: >> On 6/27/17 5:12 PM, Jeff Mahoney wrote: >>> On 6/13/17 9:05 PM, Sargun Dhillon wrote: >>>> On Thu, Jun 8, 2017 at 11:34 AM, Sargun Dhillon &l

Re: Lock between userspace and btrfs-cleaner on extent_buffer

2017-06-28 Thread Jeff Mahoney
On 6/27/17 5:12 PM, Jeff Mahoney wrote: > On 6/13/17 9:05 PM, Sargun Dhillon wrote: >> On Thu, Jun 8, 2017 at 11:34 AM, Sargun Dhillon <sar...@sargun.me> wrote: >>> I have a deadlock caught in the wild between two processes -- >>> btrfs-cleaner, and userspace pr

Re: Lock between userspace and btrfs-cleaner on extent_buffer

2017-06-27 Thread Jeff Mahoney
t_ref+0x4c/0x60 [btrfs] > [] __btrfs_mod_ref+0x152/0x240 [btrfs] > [] btrfs_inc_ref+0x14/0x20 [btrfs] > [] update_ref_for_cow+0xdc/0x340 [btrfs] > [] __btrfs_cow_block+0x218/0x5e0 [btrfs] > [] btrfs_cow_block+0xff/0x1e0 [btrfs] > [] btrfs_search_slot+0x208/0x9c0 [btrfs] > [] btrfs_truncate_inode_items+0x1a1/0x1040 [btrfs] > [] btrfs_truncate+0xfc/0x2c0 [btrfs] > [] btrfs_setattr+0x22d/0x370 [btrfs] > [] notify_change+0x2db/0x430 > [] do_truncate+0x75/0xc0 > [] path_openat+0x362/0x1450 > [] do_filp_open+0x99/0x110 > [] do_sys_open+0x124/0x210 > [] SyS_open+0x1e/0x20 > [] entry_SYSCALL_64_fastpath+0x1e/0xad > [] 0x > > We have a small emergency patch that appears to help, until an actual > solution is found (if anyone else is running into this): > diff --git a/fs/btrfs/backref.c b/fs/btrfs/backref.c > index 7699e16..e0a261a8 100644 > --- a/fs/btrfs/backref.c > +++ b/fs/btrfs/backref.c > @@ -1566,11 +1566,18 @@ int btrfs_find_all_roots(struct > btrfs_trans_handle *trans, > { > int ret; > > - if (!trans) > + if (!trans) { > down_read(_info->commit_root_sem); > + down_write(_info->find_all_root_sem); > + } else > + down_read(_info->find_all_root_sem); > + > ret = __btrfs_find_all_roots(trans, fs_info, bytenr, time_seq, roots); > - if (!trans) > + if (!trans) { > + up_write(_info->find_all_root_sem); > up_read(_info->commit_root_sem); > + } else > + up_read(_info->find_all_root_sem); > return ret; > } > > diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h > index c411590..9ed0735 100644 > --- a/fs/btrfs/ctree.h > +++ b/fs/btrfs/ctree.h > @@ -840,6 +840,8 @@ struct btrfs_fs_info { > > struct rw_semaphore commit_root_sem; > > + struct rw_semaphore find_all_root_sem; > + > struct rw_semaphore cleanup_work_sem; > > struct rw_semaphore subvol_sem; > diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c > index eb1ee7b..c227895 100644 > --- a/fs/btrfs/disk-io.c > +++ b/fs/btrfs/disk-io.c > @@ -2741,6 +2741,7 @@ int open_ctree(struct super_block *sb, > mutex_init(_info->volume_mutex); > mutex_init(_info->ro_block_group_mutex); > init_rwsem(_info->commit_root_sem); > + init_rwsem(_info->find_all_root_sem); > init_rwsem(_info->cleanup_work_sem); > init_rwsem(_info->subvol_sem); > sema_init(_info->uuid_tree_rescan_sem, 1); > -- > To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in > the body of a message to majord...@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > -- Jeff Mahoney SUSE Labs signature.asc Description: OpenPGP digital signature

[PATCH] btrfs: backref, properly iterate the missing keys

2017-06-27 Thread Jeff Mahoney
the benefit of letting us skip the refs that don't need any attention and this is used in the next patch. Signed-off-by: Jeff Mahoney <je...@suse.com> --- fs/btrfs/backref.c | 37 + 1 file changed, 25 insertions(+), 12 deletions(-) --- a/fs/btrfs/backref.c

Re: [PATCH 08/13] btrfs: convert prelimary reference tracking to use rbtrees

2017-06-27 Thread Jeff Mahoney
multiple calls to find_parent_nodes. >> >> Signed-off-by: Edmund Nadolski <enadol...@suse.com> >> Signed-off-by: Jeff Mahoney <je...@suse.com> >> --- >> fs/btrfs/backref.c | 415 >> ++--- >> 1 file c

Re: [PATCH 08/13] btrfs: convert prelimary reference tracking to use rbtrees

2017-06-27 Thread Jeff Mahoney
On 6/26/17 1:07 PM, Jeff Mahoney wrote: > On 6/20/17 12:06 PM, Edmund Nadolski wrote: >> It's been known for a while that the use of multiple lists >> that are periodically merged was an algorithmic problem within >> btrfs. There are several workloads that don't complete

Re: [PATCH 08/13] btrfs: convert prelimary reference tracking to use rbtrees

2017-06-26 Thread Jeff Mahoney
of that. This > runtime still isn't acceptable and a future patch will address that > by moving the rbtrees higher in the stack so the lookups can be > shared across multiple calls to find_parent_nodes. > > Signed-off-by: Edmund Nadolski <enadol...@suse.com> > Signed-off

Re: [PULL] Btrfs for 4.13, part 1

2017-06-25 Thread Jeff Mahoney
On 6/25/17 8:53 PM, Qu Wenruo wrote: > > > At 06/26/2017 05:34 AM, Jeff Mahoney wrote: >> On 6/24/17 6:05 AM, Wang Shilong wrote: >>> Sorry for bikeshedding. >>> >>> On Fri, Jun 23, 2017 at 11:16 PM, David Sterba <dste...@suse.com> wrote: &g

Re: [PULL] Btrfs for 4.13, part 1

2017-06-25 Thread Jeff Mahoney
t;> fs/btrfs/volumes.c | 74 +++--- >> fs/btrfs/volumes.h | 7 + >> fs/btrfs/xattr.c | 2 +- >> fs/btrfs/zlib.c | 20 +- >> include/trace/events/btrfs.h | 36 --- >> include/uapi/linux/btrfs.h

Re: [PATCH 1/2] btrfs: account for pinned bytes and bytes_may_use in should_alloc_chunk

2017-06-21 Thread Jeff Mahoney
On 6/21/17 5:15 PM, Chris Mason wrote: > > > On 06/21/2017 05:08 PM, Jeff Mahoney wrote: >> On 6/21/17 4:31 PM, Chris Mason wrote: >>> On 06/21/2017 04:14 PM, Jeff Mahoney wrote: >>>> On 6/14/17 11:44 AM, je...@suse.com wrote: >>>>> From: J

Re: [PATCH 1/2] btrfs: account for pinned bytes and bytes_may_use in should_alloc_chunk

2017-06-21 Thread Jeff Mahoney
On 6/21/17 4:31 PM, Chris Mason wrote: > On 06/21/2017 04:14 PM, Jeff Mahoney wrote: >> On 6/14/17 11:44 AM, je...@suse.com wrote: >>> From: Jeff Mahoney <je...@suse.com> >>> >>> In a heavy write scenario, we can end up with a large number of pinned

Re: [PATCH 1/2] btrfs: account for pinned bytes and bytes_may_use in should_alloc_chunk

2017-06-21 Thread Jeff Mahoney
On 6/14/17 11:44 AM, je...@suse.com wrote: > From: Jeff Mahoney <je...@suse.com> > > In a heavy write scenario, we can end up with a large number of pinned > bytes. This can translate into (very) premature ENOSPC because pinned > bytes must be accounted for when allowing a r

Re: [PATCH 7/7] Btrfs: warn if total_bytes_pinned is non-zero on unmount

2017-06-13 Thread Jeff Mahoney
derflowed or haven't released enough is helpful. While testing your patchset, I did this and it found a few bugs in cleanup after error. I'll post those patches shortly. -Jeff -- Jeff Mahoney SUSE Labs signature.asc Description: OpenPGP digital signature

Re: [PATCH 1/6] Btrfs: add a helper to retrive extent inline ref type

2017-05-26 Thread Jeff Mahoney
|| >> +type == BTRFS_SHARED_BLOCK_REF_KEY) >> +return type; >> +} >> +} >> + >> +btrfs_print_leaf(eb->fs_info, eb); >> +WARN(1, "eb %llu(%s block) invalid extent

Re: [PATCH v2 1/2] btrfs: Separate space_info create/update

2017-05-17 Thread Jeff Mahoney
>> >>>> Fix it by factoring out the creation code in a separate create_space_info >>>> structure. This also allows to simplify the internals. Furthermore it will >>>> make the update_space_info function not fail, allowing to remove error >>>> ha

Re: [PATCH 1/2] btrfs: Separate space_info create/update

2017-05-17 Thread Jeff Mahoney
FS_BLOCK_GROUP_SYSTEM; > - ret = update_space_info(fs_info, flags, 0, 0, 0, _info); > + ret = create_space_info(fs_info, flags, _info); > if (ret) > goto out; > > if (mixed) { > flags = BTRFS_BLOCK_GROUP_METADATA | BTRFS_BLOCK_GROUP_DATA; > - ret = update_space_info(fs_info, flags, 0, 0, 0, _info); > + ret = create_space_info(fs_info, flags, _info); > } else { > flags = BTRFS_BLOCK_GROUP_METADATA; > - ret = update_space_info(fs_info, flags, 0, 0, 0, _info); > + ret = create_space_info(fs_info, flags, _info); > if (ret) > goto out; > > flags = BTRFS_BLOCK_GROUP_DATA; > - ret = update_space_info(fs_info, flags, 0, 0, 0, _info); > + ret = create_space_info(fs_info, flags, _info); > } > out: > return ret; > Reviewed-by: Jeff Mahoney <je...@suse.com> -Jeff -- Jeff Mahoney SUSE Labs signature.asc Description: OpenPGP digital signature

  1   2   3   4   5   6   7   8   >