[PATCH] missing initialization in btrfs_check_shared

2018-03-14 Thread Edmund Nadolski
ops/sec) /media/scratch/file5: EXT: FILE-OFFSET BLOCK-RANGE TOTAL FLAGS 0: [0..127]:24576..24703 128 0x1 /media/scratch/file5: EXT: FILE-OFFSET BLOCK-RANGE TOTAL FLAGS 0: [0..127]:24576..24703 128 0x1 which corrects the regression. Edm

[PATCH] btrfs: add missing initialization in btrfs_check_shared

2018-03-14 Thread Edmund Nadolski
, thus causing a false shared extent indication. Signed-off-by: Edmund Nadolski <enadol...@suse.com> --- fs/btrfs/backref.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/btrfs/backref.c b/fs/btrfs/backref.c index 4e89598..4a33448 100644 --- a/fs/btrfs/backref.c +++ b/fs/btrfs/bac

Re: [PATCH 2/2] btrfs: add read_mirror_policy parameter devid

2018-02-02 Thread Edmund Nadolski
On 02/01/2018 01:12 AM, Anand Jain wrote: > > > On 02/01/2018 01:26 PM, Edmund Nadolski wrote: >> On 1/31/18 7:36 AM, Anand Jain wrote: >>> >>> >>> On 01/31/2018 09:42 PM, Nikolay Borisov wrote: >>> >>> >>>>>> So us

Re: [PATCH 2/2] btrfs: add read_mirror_policy parameter devid

2018-01-31 Thread Edmund Nadolski
On 1/31/18 7:36 AM, Anand Jain wrote: > > > On 01/31/2018 09:42 PM, Nikolay Borisov wrote: > > So usually this should be functionality handled by the raid/san controller I guess, > but given that btrfs is playing the role of a controller here at what point are we drawing the

Re: [PATCH] btrfs: remove spurious WARN_ON(ref->count) in find_parent_nodes

2018-01-23 Thread Edmund Nadolski
On 01/23/2018 12:36 AM, Lu Fengqi wrote: > On Mon, Jan 22, 2018 at 08:35:43PM -0700, Edmund Nadolski wrote: >> On 1/22/18 5:58 AM, Nikolay Borisov wrote: >>> >>> >>> On 21.01.2018 21:08, Zygo Blaxell wrote: >>>> This warning appears during exe

Re: [PATCH] btrfs: remove spurious WARN_ON(ref->count) in find_parent_nodes

2018-01-22 Thread Edmund Nadolski
t; fs/btrfs/backref.c | 1 - >> 1 file changed, 1 deletion(-) >> >> diff --git a/fs/btrfs/backref.c b/fs/btrfs/backref.c >> index 7d0dc100a09a..57e8d2562ed5 100644 >> --- a/fs/btrfs/backref.c >> +++ b/fs/btrfs/backref.c >> @@ -1263,7 +1263,6 @@ static int find_

Re: [PATCH] btrfs: remove spurious WARN_ON(ref->count) in find_parent_nodes

2018-01-22 Thread Edmund Nadolski
On 01/21/2018 08:34 PM, Lu Fengqi wrote: > On Sun, Jan 21, 2018 at 02:08:58PM -0500, Zygo Blaxell wrote: >> This warning appears during execution of the LOGICAL_INO ioctl and >> appears to be spurious: >> >> [ cut here ] >> WARNING: CPU: 3 PID: 18172 at

Re: [PATCH] btrfs: Remove btrfs_inode::delayed_iput_count

2018-01-15 Thread Edmund Nadolski
rief code comment about the i_count effect. Reviewed-by: Edmund Nadolski <enadol...@suse.com> > --- > fs/btrfs/btrfs_inode.h | 1 - > fs/btrfs/inode.c | 17 +++-- > 2 files changed, 3 insertions(+), 15 deletions(-) > > diff --git a/fs/btrfs/btrfs_inode.h

Re: [PATCH] btrfs: Streamline btrfs_delalloc_reserve_metadata initial operations

2018-01-12 Thread Edmund Nadolski
949, chg -0.02% > > No functional changes. > > Signed-off-by: Nikolay Borisov <nbori...@suse.com> Reviewed-by: Edmund Nadolski <enadol...@suse.com> > --- > fs/btrfs/extent-tree.c | 14 +++--- > 1 file changed, 7 insertions(+), 7 deletions(-) > >

Re: [PATCH 0/7] retry write on error

2017-12-04 Thread Edmund Nadolski
On 11/30/2017 01:22 PM, Liu Bo wrote: >>> If the underlying protocal doesn't support retry and there >>> are some transient errors happening somewhere in our IO >>> stack, we'd like to give an extra chance for IO. > Anyway, this is for a corner case, not for everyone, I think I need

Re: [PATCH 0/7] retry write on error

2017-11-28 Thread Edmund Nadolski
On 11/28/2017 12:22 PM, David Sterba wrote: > On Tue, Nov 21, 2017 at 05:35:51PM -0700, Liu Bo wrote: >> If the underlying protocal doesn't support retry and there are some >> transient errors happening somewhere in our IO stack, we'd like to >> give an extra chance for IO. Or sometimes you see

Re: [PATCH 2/3] btrfs: update some code documentation

2017-11-21 Thread Edmund Nadolski
On 11/21/2017 12:59 AM, Nikolay Borisov wrote: > > > On 20.11.2017 22:24, Edmund Nadolski wrote: >> Improve code documentation by adding/expanding comments in >> several places. >> >> Signed-off-by: Edmund Nadolski <enadol...@suse.com> >>

Re: [PATCH] btrfs: handle errors while updating refcounts in update_ref_for_cow

2017-11-21 Thread Edmund Nadolski
t; code. > > Fixes: fb235dc06fa (btrfs: qgroup: Move half of the qgroup accounting ...) > Cc: <sta...@vger.kernel.org> # v4.11+ > Signed-off-by: Jeff Mahoney <je...@suse.com> Reviewed-by: Edmund Nadolski <enadol...@suse.com> > --- > fs/btrfs/ctree.c | 18 +++

[PATCH 2/3] btrfs: update some code documentation

2017-11-20 Thread Edmund Nadolski
Improve code documentation by adding/expanding comments in several places. Signed-off-by: Edmund Nadolski <enadol...@suse.com> --- fs/btrfs/ctree.c| 31 +++--- fs/btrfs/ctree.h| 28 +++- fs/btrfs/extent_map.h

[PATCH 0/3] btrfs: some code cleanup and documentation

2017-11-20 Thread Edmund Nadolski
This series adds a bit of code cleanup and some documentation in the form of comments. No operational change. Edmund Nadolski (3): btrfs: btrfs_inode_log_parent should use defined inode_only values. btrfs: update some code documentation btrfs: remove dead code from btrfs_get_extent fs

[PATCH 3/3] btrfs: remove dead code from btrfs_get_extent

2017-11-20 Thread Edmund Nadolski
Due to new_inline logic, the create == 0 is always true at this point in the code, so the create != 0 branch can be removed. Signed-off-by: Edmund Nadolski <enadol...@suse.com> --- fs/btrfs/inode.c | 22 +- 1 file changed, 1 insertion(+), 21 deletions(-) diff --gi

[PATCH 1/3] btrfs: btrfs_inode_log_parent should use defined inode_only values.

2017-11-20 Thread Edmund Nadolski
Replace hardcoded numeric argument values for inode_only with the constants defined for that use. Signed-off-by: Edmund Nadolski <enadol...@suse.com> --- fs/btrfs/tree-log.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c

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

2017-11-03 Thread Edmund Nadolski
On 11/03/2017 11:20 AM, fdman...@kernel.org wrote: > From: Filipe Manana > > This implements support the zero range operation of fallocate. For now > at least it's as simple as possible while reusing most of the existing > fallocate and hole punching infrastructure. > >

Re: [PATCH 4/6] btrfs: qgroup: Fix wrong qgroup reservation inheritance for relationship update

2017-10-24 Thread Edmund Nadolski
On 10/24/2017 02:39 AM, Qu Wenruo wrote: > When modifying qgroup relationship, for qgroup which only owns exclusive > extents, we will go through quick update path. > > In quick update path, we will just adding/removing exclusive and reference > number. > > However we did the opposite for

Re: [PATCH 2/6] btrfs: qgroup: Introduce helpers to update and access new qgroup rsv

2017-10-24 Thread Edmund Nadolski
On 10/24/2017 06:05 AM, Qu Wenruo wrote: > > > On 2017年10月24日 19:07, Nikolay Borisov wrote: >> >> >> On 24.10.2017 11:39, Qu Wenruo wrote: >>> Introduce helpers to: >>> >>> 1) Get total reserved space >>>For limit calculation >>> >>> 2) Increase reserved space for given type >>> 2)

Re: [PATCH v4] btrfs: Fix transaction abort during failure in btrfs_rm_dev_item

2017-10-23 Thread Edmund Nadolski
On 10/23/2017 12:58 AM, Nikolay Borisov wrote: > btrfs_rm_dev_item calls several function under an activa transaction, however ^^ active > it fails to abort it if an error happens. Fix this by adding explicit >

Re: [PATCH 01/21] Btrfs: rework outstanding_extents

2017-10-18 Thread Edmund Nadolski
just a few quick things for the changelog: On 09/29/2017 01:43 PM, Josef Bacik wrote: > Right now we do a lot of weird hoops around outstanding_extents in order > to keep the extent count consistent. This is because we logically > transfer the outstanding_extent count from the initial

Re: [PATCH 1/3] btrfs: scrub: get rid of sector_t

2017-10-06 Thread Edmund Nadolski
On 10/06/2017 06:29 AM, David Sterba wrote: > The use of sector_t is not necessry, it's just for a warning. Switch to > u64 and rename the variable. The messages are adjusted as well. > > Signed-off-by: David Sterba > --- > fs/btrfs/scrub.c | 14 +++--- > 1 file

[PATCH v3 10/13] btrfs: backref, add tracepoints for prelim_ref insertion and merging

2017-07-12 Thread Edmund Nadolski
From: Jeff Mahoney This patch adds a tracepoint event for prelim_ref insertion and merging. For each, the ref being inserted or merged and the count of tree nodes is issued. Signed-off-by: Jeff Mahoney --- fs/btrfs/backref.c | 119

[PATCH v3 12/13] btrfs: allow backref search checks for shared extents

2017-07-12 Thread Edmund Nadolski
When called with a struct share_check, find_parent_nodes() will detect a shared extent and immediately return with BACKREF_SHARED_FOUND. Signed-off-by: Edmund Nadolski <enadol...@suse.com> Signed-off-by: Jeff Mahoney <je...@suse.com> --- fs/btrfs/bac

[PATCH v3 13/13] btrfs: clean up extraneous computations in add_delayed_refs

2017-07-12 Thread Edmund Nadolski
Repeating the same computation in multiple places is not necessary. Signed-off-by: Edmund Nadolski <enadol...@suse.com> Signed-off-by: Jeff Mahoney <je...@suse.com> --- fs/btrfs/backref.c | 30 +- 1 file changed, 13 insertions(+), 17 deletions(-) dif

[PATCH v3 09/13] btrfs: add a node counter to each of the rbtrees

2017-07-12 Thread Edmund Nadolski
From: Jeff Mahoney This patch adds counters to each of the rbtrees so that we can tell how large they are growing for a given workload. These counters will be exported by tracepoints in the next patch. Signed-off-by: Jeff Mahoney --- fs/btrfs/backref.c | 6

[PATCH v3 11/13] btrfs: add cond_resched() calls when resolving backrefs

2017-07-12 Thread Edmund Nadolski
Since backref resolution is CPU-intensive, the cond_resched calls should help alleviate soft lockup occurences. Signed-off-by: Edmund Nadolski <enadol...@suse.com> Signed-off-by: Jeff Mahoney <je...@suse.com> --- fs/btrfs/backref.c | 3 +++ 1 file changed, 3 insertions(+) diff --gi

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

2017-07-12 Thread Edmund Nadolski
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-by: Jeff Mahoney <je...@suse.com> --- fs/btrfs/backref.c | 441 ++--- 1

[PATCH v3 00/13] use rbtrees for preliminary backrefs

2017-07-12 Thread Edmund Nadolski
' comments and the unused 'merge_mode' enum. The other patches have no functional changes. Some have diff context changes due to the above modifications. Edmund Nadolski (6): btrfs: btrfs_check_shared should manage its own transaction btrfs: remove ref_tree implementation from backref.c btrfs

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

2017-07-11 Thread Edmund Nadolski
On 07/11/2017 09:15 AM, David Sterba wrote: > On Wed, Jun 28, 2017 at 09:57:00PM -0600, 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

[PATCH v2 13/13] btrfs: clean up extraneous computations in add_delayed_refs

2017-06-28 Thread Edmund Nadolski
Repeating the same computation in multiple places is not necessary. Signed-off-by: Edmund Nadolski <enadol...@suse.com> Signed-off-by: Jeff Mahoney <je...@suse.com> --- fs/btrfs/backref.c | 30 +- 1 file changed, 13 insertions(+), 17 deletions(-) dif

[PATCH v2 12/13] btrfs: allow backref search checks for shared extents

2017-06-28 Thread Edmund Nadolski
When called with a struct share_check, find_parent_nodes() will detect a shared extent and immediately return with BACKREF_SHARED_FOUND. Signed-off-by: Edmund Nadolski <enadol...@suse.com> Signed-off-by: Jeff Mahoney <je...@suse.com> --- fs/btrfs/bac

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

2017-06-28 Thread Edmund Nadolski
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-by: Jeff Mahoney <je...@suse.com> --- fs/btrfs/backref.c | 437 ++---

[PATCH v2 11/13] btrfs: add cond_resched() calls when resolving backrefs

2017-06-28 Thread Edmund Nadolski
Since backref resolution is CPU-intensive, the cond_resched calls should help alleviate soft lockup occurences. Signed-off-by: Edmund Nadolski <enadol...@suse.com> Signed-off-by: Jeff Mahoney <je...@suse.com> --- fs/btrfs/backref.c | 3 +++ 1 file changed, 3 insertions(+) diff --gi

[PATCH v2 09/13] btrfs: add a node counter to each of the rbtrees

2017-06-28 Thread Edmund Nadolski
From: Jeff Mahoney This patch adds counters to each of the rbtrees so that we can tell how large they are growing for a given workload. These counters will be exported by tracepoints in the next patch. Signed-off-by: Jeff Mahoney --- fs/btrfs/backref.c | 6

[PATCH v2 10/13] btrfs: backref, add tracepoints for prelim_ref insertion and merging

2017-06-28 Thread Edmund Nadolski
From: Jeff Mahoney This patch adds a tracepoint event for prelim_ref insertion and merging. For each, the ref being inserted or merged and the count of tree nodes is issued. Signed-off-by: Jeff Mahoney --- fs/btrfs/backref.c | 117

[PATCH v2 05/13] btrfs: backref, cleanup __ namespace abuse

2017-06-28 Thread Edmund Nadolski
From: Jeff Mahoney We typically use __ to indicate a helper routine that shouldn't be called directly without understanding the proper context required to do so. We use static functions to indicate that a function is private to a particular C file. The backref code uses static

[PATCH v2 03/13] btrfs: backref, constify some arguments

2017-06-28 Thread Edmund Nadolski
From: Jeff Mahoney This constifies a few buffers used in the backref code. Signed-off-by: Jeff Mahoney --- fs/btrfs/backref.c | 29 - 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/fs/btrfs/backref.c

[PATCH v2 07/13] btrfs: remove ref_tree implementation from backref.c

2017-06-28 Thread Edmund Nadolski
ete revert of the above commit is not desirable. This patch therefore removes the ref_tree portion of the commit as above, however it does not remove the transaction portion. Signed-off-by: Edmund Nadolski <enadol...@suse.com> Signed-off-by: Jeff Mahoney <je...@suse.com> --- fs

[PATCH v2 02/13] btrfs: constify tracepoint arguments

2017-06-28 Thread Edmund Nadolski
From: Jeff Mahoney Tracepoint arguments are all read-only. If we mark the arguments as const, we're able to keep or convert those arguments to const where appropriate. Signed-off-by: Jeff Mahoney --- fs/btrfs/async-thread.c | 6 +-

[PATCH v2 01/13] btrfs: struct-funcs, constify readers

2017-06-28 Thread Edmund Nadolski
From: Jeff Mahoney We have reader helpers for most of the on-disk structures that use an extent_buffer and pointer as offset into the buffer that are read-only. We should mark them as const and, in turn, allow consumers of these interfaces to mark the buffers const as well. No

[PATCH v2 06/13] btrfs: btrfs_check_shared should manage its own transaction

2017-06-28 Thread Edmund Nadolski
to manage transactions individually. Signed-off-by: Edmund Nadolski <enadol...@suse.com> Signed-off-by: Jeff Mahoney <je...@suse.com> --- fs/btrfs/backref.c | 30 +++--- fs/btrfs/backref.h | 4 +--- fs/btrfs/extent_io.c | 22 +++--- 3 files

[PATCH v2 00/13] use rbtrees for preliminary backrefs

2017-06-28 Thread Edmund Nadolski
WARN() with BUG_ON(). - Remove 'TODO' comments and the unused 'merge_mode' enum. The other patches have no functional changes. Some have diff context changes due to the above modifications. Edmund Nadolski (6): btrfs: btrfs_check_shared should manage its own transaction btrfs: remove ref_tree

[PATCH v2 04/13] btrfs: backref, add unode_aux_to_inode_list helper

2017-06-28 Thread Edmund Nadolski
From: Jeff Mahoney Replacing the double cast and ternary conditional with a helper makes the code easier on the eyes. Signed-off-by: Jeff Mahoney --- fs/btrfs/backref.c | 16 +++- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git

[PATCH 10/13] btrfs: backref, add tracepoints for prelim_ref insertion and merging

2017-06-20 Thread Edmund Nadolski
From: Jeff Mahoney This patch adds a tracepoint event for prelim_ref insertion and merging. For each, the ref being inserted or merged and the count of tree nodes is issued. Signed-off-by: Jeff Mahoney --- fs/btrfs/backref.c | 117

[PATCH 12/13] btrfs: allow backref search checks for shared extents

2017-06-20 Thread Edmund Nadolski
When called with a struct share_check, find_parent_nodes() will detect a shared extent and immediately return with BACKREF_SHARED_FOUND. Signed-off-by: Edmund Nadolski <enadol...@suse.com> Signed-off-by: Jeff Mahoney <je...@suse.com> --- fs/btrfs/bac

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

2017-06-20 Thread Edmund Nadolski
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-by: Jeff Mahoney <je...@suse.com> --- fs/btrfs/backref.c | 415 ++---

[PATCH 02/13] btrfs: constify tracepoint arguments

2017-06-20 Thread Edmund Nadolski
From: Jeff Mahoney Tracepoint arguments are all read-only. If we mark the arguments as const, we're able to keep or convert those arguments to const where appropriate. Signed-off-by: Jeff Mahoney --- fs/btrfs/async-thread.c | 6 +-

[PATCH 13/13] btrfs: clean up extraneous computations in add_delayed_refs

2017-06-20 Thread Edmund Nadolski
Repeating the same computation in multiple places is not necessary. Signed-off-by: Edmund Nadolski <enadol...@suse.com> Signed-off-by: Jeff Mahoney <je...@suse.com> --- fs/btrfs/backref.c | 30 +- 1 file changed, 13 insertions(+), 17 deletions(-) dif

[PATCH 11/13] btrfs: add cond_resched() calls when resolving backrefs

2017-06-20 Thread Edmund Nadolski
Since backref resolution is CPU-intensive, the cond_resched calls should help alleviate soft lockup occurences. Signed-off-by: Edmund Nadolski <enadol...@suse.com> Signed-off-by: Jeff Mahoney <je...@suse.com> --- fs/btrfs/backref.c | 3 +++ 1 file changed, 3 insertions(+) diff --gi

[PATCH 01/13] btrfs: struct-funcs, constify readers

2017-06-20 Thread Edmund Nadolski
From: Jeff Mahoney We have reader helpers for most of the on-disk structures that use an extent_buffer and pointer as offset into the buffer that are read-only. We should mark them as const and, in turn, allow consumers of these interfaces to mark the buffers const as well. No

[PATCH 09/13] btrfs: add a node counter to each of the rbtrees

2017-06-20 Thread Edmund Nadolski
From: Jeff Mahoney This patch adds counters to each of the rbtrees so that we can tell how large they are growing for a given workload. These counters will be exported by tracepoints in the next patch. Signed-off-by: Jeff Mahoney --- fs/btrfs/backref.c | 6

[PATCH 04/13] btrfs: backref, add unode_aux_to_inode_list helper

2017-06-20 Thread Edmund Nadolski
From: Jeff Mahoney Replacing the double cast and ternary conditional with a helper makes the code easier on the eyes. Signed-off-by: Jeff Mahoney --- fs/btrfs/backref.c | 16 +++- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git

[PATCH 07/13] btrfs: remove ref_tree implementation from backref.c

2017-06-20 Thread Edmund Nadolski
The BACKREF_FOUND_SHARED checking will be addressed in an upcoming patch. Signed-off-by: Edmund Nadolski <enadol...@suse.com> Signed-off-by: Jeff Mahoney <je...@suse.com> --- fs/btrfs/backref.c | 356 ++--- 1 file changed, 8 insert

[PATCH 05/13] btrfs: backref, cleanup __ namespace abuse

2017-06-20 Thread Edmund Nadolski
From: Jeff Mahoney We typically use __ to indicate a helper routine that shouldn't be called directly without understanding the proper context required to do so. We use static functions to indicate that a function is private to a particular C file. The backref code uses static

[PATCH 03/13] btrfs: backref, constify some arguments

2017-06-20 Thread Edmund Nadolski
From: Jeff Mahoney This constifies a few buffers used in the backref code. Signed-off-by: Jeff Mahoney --- fs/btrfs/backref.c | 29 - 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/fs/btrfs/backref.c

[PATCH 06/13] btrfs: btrfs_check_shared should manage its own transaction

2017-06-20 Thread Edmund Nadolski
Signed-off-by: Edmund Nadolski <enadol...@suse.com> Signed-off-by: Jeff Mahoney <je...@suse.com> --- fs/btrfs/backref.c | 30 +++--- fs/btrfs/backref.h | 4 +--- fs/btrfs/extent_io.c | 22 +++--- 3 files changed, 23 insertions(+), 33 deleti

[PATCH 00/13] use rbtrees for preliminary backrefs

2017-06-20 Thread Edmund Nadolski
: 12 93203106022007 (Note, the current default value for nr_extents in btrfs/130 is 4096, which takes a very long time to complete.) Edmund Nadolski (6): btrfs: btrfs_check_shared should manage its own transaction btrfs: remove ref_tree implementation from backref.c btrfs