Re: Inconsistence between sender and receiver

2018-03-08 Thread Andrei Borzenkov
09.03.2018 08:38, Liu Bo пишет: > On Thu, Mar 08, 2018 at 09:15:50AM +0300, Andrei Borzenkov wrote: >> 07.03.2018 21:49, Liu Bo пишет: >>> Hi, >>> >>> In the following steps[1], if on receiver side has got >>> changed via 'btrfs property set', then after doing incremental >>> updates, receiver

Re: [PATCH] Btrfs: replace: cache rbio when rebuild data on missing device

2018-03-08 Thread Liu Bo
On Tue, Mar 06, 2018 at 12:28:18PM +0100, David Sterba wrote: > On Fri, Mar 02, 2018 at 04:10:38PM -0700, Liu Bo wrote: > > Rebuild on missing device is as same as recover, after it's done, rbio > > has data which is consistent with on-disk data, so it can be cached to > > avoid further reads. >

Re: Inconsistence between sender and receiver

2018-03-08 Thread Liu Bo
On Thu, Mar 08, 2018 at 03:29:48PM +, Filipe Manana wrote: > On Wed, Mar 7, 2018 at 6:49 PM, Liu Bo wrote: > > Hi, > > > > In the following steps[1], if on receiver side has got > > changed via 'btrfs property set', then after doing incremental > > updates, receiver

Re: Inconsistence between sender and receiver

2018-03-08 Thread Liu Bo
On Thu, Mar 08, 2018 at 09:15:50AM +0300, Andrei Borzenkov wrote: > 07.03.2018 21:49, Liu Bo пишет: > > Hi, > > > > In the following steps[1], if on receiver side has got > > changed via 'btrfs property set', then after doing incremental > > updates, receiver gets a different snapshot from what

Re: [PATCH] kernel.h: Skip single-eval logic on literals in min()/max()

2018-03-08 Thread Kees Cook
On Thu, Mar 8, 2018 at 5:35 PM, Linus Torvalds wrote: > I don't want to weaken the type enforcement, and I _thought_ you had > done that __builtin_types_compatible_p() to keep it in place. I thought so too (that originally came from Josh), but on removal, I was

Re: [PATCH] kernel.h: Skip single-eval logic on literals in min()/max()

2018-03-08 Thread Linus Torvalds
On Thu, Mar 8, 2018 at 4:45 PM, Kees Cook wrote: > > Rasmus mentioned this too. What I said there was that I was shy to > make that change, since we already can't mix that kind of thing with > the existing min()/max() implementation. The existing min()/max() is > already

Re: [PATCH 2/2] btrfs: Add unprivileged version of ino_lookup ioctl

2018-03-08 Thread Misono, Tomohiro
On 2018/03/08 18:47, Nikolay Borisov wrote: > > > On 6.03.2018 10:31, Misono, Tomohiro wrote: >> Add unprivileged version of ino_lookup ioctl (BTRFS_IOC_INO_LOOKUP_USER) >> to allow normal users to call "btrfs subvololume list/show" etc. in >> combination with BTRFS_IOC_GET_SUBVOL_INFO. >> >>

Re: [PATCH 1/2] btrfs: Add unprivileged subvolume search ioctl

2018-03-08 Thread Misono, Tomohiro
On 2018/03/08 17:29, Nikolay Borisov wrote: > > > On 6.03.2018 10:30, Misono, Tomohiro wrote: >> Add new unprivileged ioctl (BTRFS_IOC_GET_SUBVOL_INFO) which searches >> and returns only subvolume related item (ROOT_ITEM/ROOT_BACKREF/ROOT_REF) >> from root tree. The arguments of this ioctl are

Re: [PATCH 1/2] btrfs: Add unprivileged subvolume search ioctl

2018-03-08 Thread Misono, Tomohiro
On 2018/03/08 4:00, Goffredo Baroncelli wrote: > On 03/07/2018 01:40 AM, Misono, Tomohiro wrote: >> On 2018/03/07 5:29, Goffredo Baroncelli wrote: >>> On 03/06/2018 09:30 AM, Misono, Tomohiro wrote: Add new unprivileged ioctl (BTRFS_IOC_GET_SUBVOL_INFO) which searches and returns only

Re: [PATCH] kernel.h: Skip single-eval logic on literals in min()/max()

2018-03-08 Thread Kees Cook
On Thu, Mar 8, 2018 at 3:48 PM, Linus Torvalds wrote: > On Thu, Mar 8, 2018 at 1:40 PM, Kees Cook wrote: >> +#define __min(t1, t2, x, y)\ >> + __builtin_choose_expr(__builtin_constant_p(x) &&

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

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

Re: [PATCH] kernel.h: Skip single-eval logic on literals in min()/max()

2018-03-08 Thread Linus Torvalds
On Thu, Mar 8, 2018 at 1:40 PM, Kees Cook wrote: > +#define __min(t1, t2, x, y)\ > + __builtin_choose_expr(__builtin_constant_p(x) &&\ > + __builtin_constant_p(y) &&

Re: spurious full btrfs corruption

2018-03-08 Thread Qu Wenruo
On 2018年03月08日 22:38, Christoph Anton Mitterer wrote: > Hey. > > > On Tue, 2018-03-06 at 09:50 +0800, Qu Wenruo wrote: >>> These were the two files: >>> -rw-r--r-- 1 calestyo calestyo 90112 Feb 22 16:46 'Lady In The >>> Water/05.mp3' >>> -rw-r--r-- 1 calestyo calestyo 4892407 Feb 27 23:28

[PATCH v2] kernel.h: Skip single-eval logic on literals in min()/max()

2018-03-08 Thread Kees Cook
When max() is used in stack array size calculations from literal values (e.g. "char foo[max(sizeof(struct1), sizeof(struct2))]", the compiler thinks this is a dynamic calculation due to the single-eval logic, which is not needed in the literal case. This change removes several accidental stack

Re: [PATCH 0/3] Remove accidental VLA usage

2018-03-08 Thread Kees Cook
On Thu, Mar 8, 2018 at 2:12 PM, Rasmus Villemoes wrote: > On 8 March 2018 at 21:39, Kees Cook wrote: >> However, this works for me: >> >> #define __new_max(t1, t2, max1, max2, x, y)\ >>

Re: [PATCH v2] btrfs-progs: free-space-cache: Enhance free space cache free space check

2018-03-08 Thread Qu Wenruo
On 2018年03月08日 22:05, Nikolay Borisov wrote: > > > On 8.03.2018 09:02, Qu Wenruo wrote: >> When we found free space difference between free space cache and block >> group item, we just discard this free space cache. >> >> Normally such difference is caused by btrfs_reserve_extent() called by

Re: [PATCH] kernel.h: Skip single-eval logic on literals in min()/max()

2018-03-08 Thread Kees Cook
On Thu, Mar 8, 2018 at 2:18 PM, Andrew Morton wrote: > On Thu, 8 Mar 2018 13:40:45 -0800 Kees Cook wrote: > >> When max() is used in stack array size calculations from literal values >> (e.g. "char foo[max(sizeof(struct1), sizeof(struct2))]", the

Re: [PATCH] kernel.h: Skip single-eval logic on literals in min()/max()

2018-03-08 Thread Andrew Morton
On Thu, 8 Mar 2018 13:40:45 -0800 Kees Cook wrote: > When max() is used in stack array size calculations from literal values > (e.g. "char foo[max(sizeof(struct1), sizeof(struct2))]", the compiler > thinks this is a dynamic calculation due to the single-eval logic, which >

Re: [PATCH] kernel.h: Skip single-eval logic on literals in min()/max()

2018-03-08 Thread Ian Campbell
On Thu, 2018-03-08 at 13:40 -0800, Kees Cook wrote: > > +#define __min(t1, t2, x, y) \ > + __builtin_choose_expr(__builtin_constant_p(x) &&\ > + __builtin_constant_p(y) &&\ > +

Re: [PATCH 0/3] Remove accidental VLA usage

2018-03-08 Thread Rasmus Villemoes
On 8 March 2018 at 21:39, Kees Cook wrote: > On Thu, Mar 8, 2018 at 11:57 AM, Rasmus Villemoes > wrote: >> On 2018-03-08 16:02, Josh Poimboeuf wrote: >>> On Wed, Mar 07, 2018 at 07:30:44PM -0800, Kees Cook wrote: >>> +extern long

[PATCH] kernel.h: Skip single-eval logic on literals in min()/max()

2018-03-08 Thread Kees Cook
When max() is used in stack array size calculations from literal values (e.g. "char foo[max(sizeof(struct1), sizeof(struct2))]", the compiler thinks this is a dynamic calculation due to the single-eval logic, which is not needed in the literal case. This change removes several accidental stack

Re: [PATCH 0/3] Remove accidental VLA usage

2018-03-08 Thread Andrew Morton
On Thu, 8 Mar 2018 09:02:36 -0600 Josh Poimboeuf wrote: > On Wed, Mar 07, 2018 at 07:30:44PM -0800, Kees Cook wrote: > > This series adds SIMPLE_MAX() to be used in places where a stack array > > is actually fixed, but the compiler still warns about VLA usage due to > >

Re: [PATCH 0/3] Remove accidental VLA usage

2018-03-08 Thread Kees Cook
On Thu, Mar 8, 2018 at 11:57 AM, Rasmus Villemoes wrote: > On 2018-03-08 16:02, Josh Poimboeuf wrote: >> On Wed, Mar 07, 2018 at 07:30:44PM -0800, Kees Cook wrote: >>> This series adds SIMPLE_MAX() to be used in places where a stack array >>> is actually fixed, but the

Re: [PATCH 0/3] Remove accidental VLA usage

2018-03-08 Thread Rasmus Villemoes
On 2018-03-08 16:02, Josh Poimboeuf wrote: > On Wed, Mar 07, 2018 at 07:30:44PM -0800, Kees Cook wrote: >> This series adds SIMPLE_MAX() to be used in places where a stack array >> is actually fixed, but the compiler still warns about VLA usage due to >> confusion caused by the safety checks in

Re: How to change/fix 'Received UUID'

2018-03-08 Thread Marc MERLIN
On Thu, Mar 08, 2018 at 09:36:49PM +0300, Andrei Borzenkov wrote: > Yes. Your source has Received UUID. In this case btrfs send will > transmit received UUID instead of subvolume UUID as reference to base > snapshot. You need to either clear received UUID on source or set > received UUID on

Re: [PATCH v2] btrfs: Add nossd_spread mount option

2018-03-08 Thread Omar Sandoval
On Thu, Mar 08, 2018 at 10:48:48AM -0800, Howard McLauchlan wrote: > Btrfs has two mount options for SSD optimizations: ssd and ssd_spread. > Presently there is an option to disable all SSD optimizations, but there > isn't an option to disable just ssd_spread. > > This patch adds a mount option

[PATCH v2] btrfs: Add nossd_spread mount option

2018-03-08 Thread Howard McLauchlan
Btrfs has two mount options for SSD optimizations: ssd and ssd_spread. Presently there is an option to disable all SSD optimizations, but there isn't an option to disable just ssd_spread. This patch adds a mount option nossd_spread that disables ssd_spread only. Reviewed-by: Josef Bacik

Re: How to change/fix 'Received UUID'

2018-03-08 Thread Andrei Borzenkov
08.03.2018 19:02, Marc MERLIN пишет: > On Thu, Mar 08, 2018 at 09:34:45AM +0300, Andrei Borzenkov wrote: >> 08.03.2018 09:06, Marc MERLIN пишет: >>> On Tue, Mar 06, 2018 at 12:02:47PM -0800, Marc MERLIN wrote: >

Re: [PATCH] fstests: test regression of -EEXIST on creating new file after log replay

2018-03-08 Thread Liu Bo
On Thu, Mar 08, 2018 at 10:07:33AM +, Filipe Manana wrote: > On Wed, Mar 7, 2018 at 11:59 PM, Liu Bo wrote: > > The regression is introduced to btrfs in linux v4.4 and it refuses to create > > new files after log replay by returning -EEXIST. > > > > Although the problem

Re: [PATCH 0/3] Remove accidental VLA usage

2018-03-08 Thread Josh Poimboeuf
On Thu, Mar 08, 2018 at 10:02:01AM -0800, Kees Cook wrote: > On Thu, Mar 8, 2018 at 7:02 AM, Josh Poimboeuf wrote: > > On Wed, Mar 07, 2018 at 07:30:44PM -0800, Kees Cook wrote: > >> This series adds SIMPLE_MAX() to be used in places where a stack array > >> is actually

Re: [PATCH 0/3] Remove accidental VLA usage

2018-03-08 Thread Steven Rostedt
On Thu, 8 Mar 2018 09:02:36 -0600 Josh Poimboeuf wrote: > On Wed, Mar 07, 2018 at 07:30:44PM -0800, Kees Cook wrote: > > This series adds SIMPLE_MAX() to be used in places where a stack array > > is actually fixed, but the compiler still warns about VLA usage due to > >

Re: [PATCH 0/3] Remove accidental VLA usage

2018-03-08 Thread Kees Cook
On Thu, Mar 8, 2018 at 7:02 AM, Josh Poimboeuf wrote: > On Wed, Mar 07, 2018 at 07:30:44PM -0800, Kees Cook wrote: >> This series adds SIMPLE_MAX() to be used in places where a stack array >> is actually fixed, but the compiler still warns about VLA usage due to >> confusion

Re: Ongoing Btrfs stability issues

2018-03-08 Thread Alex Adriaanse
On Mar 2, 2018, at 11:29 AM, Liu Bo wrote: > On Thu, Mar 01, 2018 at 09:40:41PM +0200, Nikolay Borisov wrote: >> On 1.03.2018 21:04, Alex Adriaanse wrote: >>> Thanks so much for the suggestions so far, everyone. I wanted to report >>> back on this. Last Friday I made the

Re: [PATCH 2/2] btrfs: replace waitqueue_actvie with cond_wake_up

2018-03-08 Thread David Sterba
On Thu, Mar 08, 2018 at 02:19:28PM +0200, Nikolay Borisov wrote: > > @@ -941,9 +941,7 @@ void btrfs_bio_counter_inc_noblocked(struct > > btrfs_fs_info *fs_info) > > void btrfs_bio_counter_sub(struct btrfs_fs_info *fs_info, s64 amount) > > { > > percpu_counter_sub(_info->bio_counter,

Re: How to change/fix 'Received UUID'

2018-03-08 Thread Marc MERLIN
On Thu, Mar 08, 2018 at 09:34:45AM +0300, Andrei Borzenkov wrote: > 08.03.2018 09:06, Marc MERLIN пишет: > > On Tue, Mar 06, 2018 at 12:02:47PM -0800, Marc MERLIN wrote: > >>> https://github.com/knorrie/python-btrfs/commit/1ace623f95300ecf581b1182780fd6432a46b24d > >> > >> Well, I had never heard

Re: [PATCH 14/22] btrfs: remove trivial locking wrappers of tree mod log

2018-03-08 Thread David Sterba
On Thu, Mar 08, 2018 at 05:37:33PM +0200, Nikolay Borisov wrote: > > > On 8.03.2018 16:33, David Sterba wrote: > > The wrappers are trivial and do bring any extra value on top of the > > nit: s/do/don't/ ? Right, fixed. > > plain locking primitives. > > > > Signed-off-by: David Sterba

Re: [PATCH 18/22] btrfs: move allocation after simple tests in tree_mod_log_insert_key

2018-03-08 Thread David Sterba
On Thu, Mar 08, 2018 at 03:26:11PM +, Filipe Manana wrote: > On Thu, Mar 8, 2018 at 2:33 PM, David Sterba wrote: > > The allocation of tree_mod_elem can be delayed after tree_mod_dont_log. > > In case it causes the function to return, the allocation would be > > redundant.

Re: [PATCH 14/22] btrfs: remove trivial locking wrappers of tree mod log

2018-03-08 Thread Nikolay Borisov
On 8.03.2018 16:33, David Sterba wrote: > The wrappers are trivial and do bring any extra value on top of the nit: s/do/don't/ ? > plain locking primitives. > > Signed-off-by: David Sterba Just 2 minor nits, otherwise LGTM: Reviewed-by: Nikolay Borisov

Re: [PATCH 17/22] btrfs: kill tree_mod_log_set_root_pointer helper

2018-03-08 Thread Nikolay Borisov
On 8.03.2018 16:33, David Sterba wrote: > A useless wrapper around tree_mod_log_insert_root that hides missing > error handling. Move it to the callers. > > Signed-off-by: David Sterba For 15-17: Reviewed-by: Nikolay Borisov > --- > fs/btrfs/ctree.c |

Re: Inconsistence between sender and receiver

2018-03-08 Thread Filipe Manana
On Wed, Mar 7, 2018 at 6:49 PM, Liu Bo wrote: > Hi, > > In the following steps[1], if on receiver side has got > changed via 'btrfs property set', then after doing incremental > updates, receiver gets a different snapshot from what sender has sent. > > The reason behind it

Re: [PATCH 18/22] btrfs: move allocation after simple tests in tree_mod_log_insert_key

2018-03-08 Thread Filipe Manana
On Thu, Mar 8, 2018 at 2:33 PM, David Sterba wrote: > The allocation of tree_mod_elem can be delayed after tree_mod_dont_log. > In case it causes the function to return, the allocation would be > redundant. Otherwise it could cause unnecessary failure if there's not > enough

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 >> >> The only mechanism we have in the progs for searching qgroups is to load >> all of them and filter the results. This works for qgroup show but >> to add quota

Re: [PATCH 0/3] Remove accidental VLA usage

2018-03-08 Thread Josh Poimboeuf
On Wed, Mar 07, 2018 at 07:30:44PM -0800, Kees Cook wrote: > This series adds SIMPLE_MAX() to be used in places where a stack array > is actually fixed, but the compiler still warns about VLA usage due to > confusion caused by the safety checks in the max() macro. > > I'm sending these via -mm

Re: spurious full btrfs corruption

2018-03-08 Thread Christoph Anton Mitterer
Hey. On Tue, 2018-03-06 at 09:50 +0800, Qu Wenruo wrote: > > These were the two files: > > -rw-r--r-- 1 calestyo calestyo 90112 Feb 22 16:46 'Lady In The > > Water/05.mp3' > > -rw-r--r-- 1 calestyo calestyo 4892407 Feb 27 23:28 > > '/home/calestyo/share/music/Lady In The Water/05.mp3' > > > >

[PATCH 19/22] btrfs: separate types for submit_bio_start and submit_bio_done

2018-03-08 Thread David Sterba
The callbacks make use of different parameters that are passed to the other type unnecessarily. This patch adds separate types for each and the unused parameters will be removed. The type extent_submit_bio_hook_t keeps all parameters and can be used where the start/done types are not appropriate.

[PATCH 18/22] btrfs: move allocation after simple tests in tree_mod_log_insert_key

2018-03-08 Thread David Sterba
The allocation of tree_mod_elem can be delayed after tree_mod_dont_log. In case it causes the function to return, the allocation would be redundant. Otherwise it could cause unnecessary failure if there's not enough memory. Signed-off-by: David Sterba --- fs/btrfs/ctree.c | 8

[PATCH 10/22] btrfs: drop fs_info parameter from tree_mod_log_free_eb

2018-03-08 Thread David Sterba
It's provided by the extent_buffer. Signed-off-by: David Sterba --- fs/btrfs/ctree.c | 11 --- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c index 6d2f8562bb36..632beadf5725 100644 --- a/fs/btrfs/ctree.c +++

[PATCH 12/22] btrfs: embed tree_mod_move structure to tree_mod_elem

2018-03-08 Thread David Sterba
The tree_mod_move is not used anywhere and can be embedded as anonymous structure. Signed-off-by: David Sterba --- fs/btrfs/ctree.c | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c index

[PATCH 22/22] btrfs: rename submit callbacks and drop double underscores

2018-03-08 Thread David Sterba
Signed-off-by: David Sterba --- fs/btrfs/disk-io.c | 8 fs/btrfs/inode.c | 23 +++ 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index f24522a6f36f..e112708e3e9b 100644 ---

[PATCH 20/22] btrfs: remove unused parameters from extent_submit_bio_start_t

2018-03-08 Thread David Sterba
Remove parameters not used by any of the callbacks. Signed-off-by: David Sterba --- fs/btrfs/disk-io.c | 2 -- fs/btrfs/extent_io.h | 3 +-- fs/btrfs/inode.c | 4 +--- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c

[PATCH 17/22] btrfs: kill tree_mod_log_set_root_pointer helper

2018-03-08 Thread David Sterba
A useless wrapper around tree_mod_log_insert_root that hides missing error handling. Move it to the callers. Signed-off-by: David Sterba --- fs/btrfs/ctree.c | 20 +++- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/fs/btrfs/ctree.c

[PATCH 16/22] btrfs: kill tree_mod_log_set_node_key helper

2018-03-08 Thread David Sterba
A trivial wrapper that can be simply opencoded and makes the GFP allocation request more visible. The error handling is now moved to the callers. Signed-off-by: David Sterba --- fs/btrfs/ctree.c | 32 +--- 1 file changed, 17 insertions(+), 15

[PATCH 21/22] btrfs: remove unused parameters from extent_submit_bio_done_t

2018-03-08 Thread David Sterba
Remove parameters not used by any of the callbacks. Signed-off-by: David Sterba --- fs/btrfs/disk-io.c | 6 ++ fs/btrfs/extent_io.h | 3 +-- fs/btrfs/inode.c | 3 +-- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/fs/btrfs/disk-io.c

[PATCH 15/22] btrfs: kill trivial wrapper tree_mod_log_eb_move

2018-03-08 Thread David Sterba
The wrapper is effectively an alias for tree_mod_log_insert_move but also hides the missing error handling. To make that more visible, lift the BUG_ON to the callers. Signed-off-by: David Sterba --- fs/btrfs/ctree.c | 27 --- 1 file changed, 12

[PATCH 14/22] btrfs: remove trivial locking wrappers of tree mod log

2018-03-08 Thread David Sterba
The wrappers are trivial and do bring any extra value on top of the plain locking primitives. Signed-off-by: David Sterba --- fs/btrfs/ctree.c | 58 +++- 1 file changed, 19 insertions(+), 39 deletions(-) diff --git

[PATCH 11/22] btrfs: drop unused fs_info parameter from tree_mod_log_eb_move

2018-03-08 Thread David Sterba
Signed-off-by: David Sterba --- fs/btrfs/ctree.c | 13 ++--- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c index 632beadf5725..5585433eac40 100644 --- a/fs/btrfs/ctree.c +++ b/fs/btrfs/ctree.c @@ -859,8 +859,7 @@

[PATCH 13/22] btrfs: drop fs_info parameter from __tree_mod_log_oldest_root

2018-03-08 Thread David Sterba
It's provided by the extent_buffer. Signed-off-by: David Sterba --- fs/btrfs/ctree.c | 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c index e53af58697db..716c140798c3 100644 --- a/fs/btrfs/ctree.c +++

[PATCH 03/22] btrfs: remove redundant variable in __do_readpage

2018-03-08 Thread David Sterba
The value of page_end is only stored to end, no other use. Signed-off-by: David Sterba --- fs/btrfs/extent_io.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index 36514baa661e..ffcbdb2390a1 100644 ---

[PATCH 06/22] btrfs: drop fs_info parameter from tree_mod_log_set_node_key

2018-03-08 Thread David Sterba
It's provided by the extent_buffer. Signed-off-by: David Sterba --- fs/btrfs/ctree.c | 19 --- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c index b88a79e69ddf..11e985ca0bc2 100644 --- a/fs/btrfs/ctree.c +++

[PATCH 04/22] btrfs: cleanup merging conditions in submit_extent_page

2018-03-08 Thread David Sterba
The merge call was factored out to a separate helper but it's a trivial one and arguably we can opencode it and cache the value. Signed-off-by: David Sterba --- fs/btrfs/extent_io.c | 26 +- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git

[PATCH 08/22] btrfs: drop fs_info parameter from tree_mod_log_insert_key

2018-03-08 Thread David Sterba
It's provided by the extent_buffer. Signed-off-by: David Sterba --- fs/btrfs/ctree.c | 27 --- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c index 3b707af76579..60e27bef0e27 100644 ---

[PATCH 09/22] btrfs: drop fs_info parameter from tree_mod_log_free_eb

2018-03-08 Thread David Sterba
It's provided by the extent_buffer. Signed-off-by: David Sterba --- fs/btrfs/ctree.c | 15 ++- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c index 60e27bef0e27..6d2f8562bb36 100644 --- a/fs/btrfs/ctree.c +++

[PATCH 05/22] btrfs: document more parameters of submit_extent_page

2018-03-08 Thread David Sterba
Signed-off-by: David Sterba --- fs/btrfs/extent_io.c | 12 1 file changed, 12 insertions(+) diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index 2fbc58b0b908..f1d199c8883e 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c @@ -2746,7 +2746,19

[PATCH 07/22] btrfs: drop fs_info parameter from tree_mod_log_insert_move

2018-03-08 Thread David Sterba
It's provided by the extent_buffer. Signed-off-by: David Sterba --- fs/btrfs/ctree.c | 23 ++- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c index 11e985ca0bc2..3b707af76579 100644 --- a/fs/btrfs/ctree.c

[PATCH 01/22] btrfs: assume that bio_ret is always valid in submit_extent_page

2018-03-08 Thread David Sterba
All callers pass a valid pointer so we can drop the redundant checks. The call to submit_one_bio never happend and can be removed. Signed-off-by: David Sterba --- fs/btrfs/extent_io.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git

[PATCH 02/22] btrfs: assume that prev_em_start is always valid in __do_readpage

2018-03-08 Thread David Sterba
All callers pass a valid pointer, we can remove the redundant checks. Signed-off-by: David Sterba --- fs/btrfs/extent_io.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index d00d5a59ff21..36514baa661e

[PATCH 00/22] Misc cleanups

2018-03-08 Thread David Sterba
Cleanups that have piled over the time. The "very important" unused argument removals, some renaming and simplifications. The effects on stack consumption are not huge, but still measurable: ctree.c:tree_mod_log_insert_key +16 (48 -> 64) ctree.c:tree_mod_log_insert_move

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 >> >> The btrfs qgroup show command currently only exports qgroup IDs, >> forcing the user to resolve which subvolume each corresponds to. >> >> This patch adds pathname

Re: [PATCH v2] btrfs-progs: free-space-cache: Enhance free space cache free space check

2018-03-08 Thread Nikolay Borisov
On 8.03.2018 09:02, Qu Wenruo wrote: > When we found free space difference between free space cache and block > group item, we just discard this free space cache. > > Normally such difference is caused by btrfs_reserve_extent() called by > delalloc which is out of a transaction. > And since

Re: [PATCH] Improve error stats message

2018-03-08 Thread Anand Jain
On 03/08/2018 01:37 AM, Diego wrote: A typical notification of filesystem errors looks like this: BTRFS error (device sda2): bdev /dev/sda2 errs: wr 0, rd 1, flush 0, corrupt 0, gen 0 The device name is being printed twice. Also, these abbreviatures feel unnecesary. Make the message look

Re: Per subvolume "RAID" level?!

2018-03-08 Thread Austin S. Hemmelgarn
On 2018-03-08 05:36, waxhead wrote: Just out of curiosity, are there any work going on for enabling different "RAID" levels per subvolume?! Not that I know of, but it would be great to have (I could get rid of some of the various small isolated volumes I have solely to have a different storage

Re: [PATCH 1/2] btrfs: introduce conditional wakeup helpers

2018-03-08 Thread Nikolay Borisov
On 8.03.2018 13:49, David Sterba wrote: > Add convenience wrappers for the waitqueue management that involves > memory barriers to prevent deadlocks. The helpers will let us remove > barriers and the necessary comments in several places. > > Signed-off-by: David Sterba

Re: [PATCH 2/2] btrfs: replace waitqueue_actvie with cond_wake_up

2018-03-08 Thread Nikolay Borisov
On 8.03.2018 13:49, David Sterba wrote: > Use the wrappers and reduce the amount of low-level details about the > waitqueue management. > > Signed-off-by: David Sterba > --- > fs/btrfs/compression.c | 7 +-- > fs/btrfs/delayed-inode.c | 9 +++-- >

[PATCH 2/2] btrfs: replace waitqueue_actvie with cond_wake_up

2018-03-08 Thread David Sterba
Use the wrappers and reduce the amount of low-level details about the waitqueue management. Signed-off-by: David Sterba --- fs/btrfs/compression.c | 7 +-- fs/btrfs/delayed-inode.c | 9 +++-- fs/btrfs/dev-replace.c | 10 -- fs/btrfs/extent-tree.c | 7

[PATCH 0/2] Cleanup waitqueue_active and barriers

2018-03-08 Thread David Sterba
This is depends on current misc-next with "btrfs: Relax memory barrier in btrfs_tree_unlock". David Sterba (2): btrfs: introduce conditional wakeup helpers btrfs: replace waitqueue_actvie with cond_wake_up fs/btrfs/compression.c | 7 +-- fs/btrfs/ctree.h | 23

[PATCH 1/2] btrfs: introduce conditional wakeup helpers

2018-03-08 Thread David Sterba
Add convenience wrappers for the waitqueue management that involves memory barriers to prevent deadlocks. The helpers will let us remove barriers and the necessary comments in several places. Signed-off-by: David Sterba --- fs/btrfs/ctree.h | 23 +++ 1 file

Re: [PATCH 3/3] btrfs: tree-checker: Avoid accidental stack VLA

2018-03-08 Thread David Sterba
On Wed, Mar 07, 2018 at 07:30:47PM -0800, Kees Cook wrote: > In the quest to remove all stack VLAs from the kernel[1], this refactors > the stack array size calculation to avoid using max(), which makes the > compiler think the size isn't fixed. > > [1] https://lkml.org/lkml/2018/3/7/621 > >

Re: [PATCH v2 1/3] vsprintf: Remove accidental VLA usage

2018-03-08 Thread Thomas Gleixner
On Thu, 8 Mar 2018, Rasmus Villemoes wrote: > On 2018-03-08 04:30, Kees Cook wrote: > > /** > > + * SIMPLE_MAX - return maximum of two values without any type checking > > + * @x: first value > > + * @y: second value > > + * > > + * This should only be used in stack array sizes, since the

Re: dmesg flooded with "Very big device. Trying to use READ CAPACITY(16)" with 8TB HDDs

2018-03-08 Thread Menion
Actually this path can be taken in few occurrency 1) device probe, only when the device is plugged or detected the first time 2) revalidate_disk fops of block device Is it possible that BTRFS every 5 minutes call the revalidate_disk? 2018-03-08 11:16 GMT+01:00 Menion : > Hi

Re: [PATCH] fstests: test regression of -EEXIST on creating new file after log replay

2018-03-08 Thread Filipe Manana
On Wed, Mar 7, 2018 at 11:59 PM, Liu Bo wrote: > The regression is introduced to btrfs in linux v4.4 and it refuses to create > new files after log replay by returning -EEXIST. > > Although the problem is on btrfs only, there is no btrfs stuff in terms of > test, so this

Per subvolume "RAID" level?!

2018-03-08 Thread waxhead
Just out of curiosity, are there any work going on for enabling different "RAID" levels per subvolume?! And out of even more curiosity how is this planned to be handled with btrfs balance?! When per subvolume "RAID" levels are good to go, how would you then run the balance filters to convert

Re: dmesg flooded with "Very big device. Trying to use READ CAPACITY(16)" with 8TB HDDs

2018-03-08 Thread Menion
Hi again I had a discussion in linux-scsi about this topic My understanding is that it is true that the read_capacity is opaque to the filesystem but it is also true that the scsi layer export two specific read_capacity ops, the read10 and read16 and the upper layers shall select the proper one,

Re: [PATCH] fstests: test regression of -EEXIST on creating new file after log replay

2018-03-08 Thread Filipe Manana
On Wed, Mar 7, 2018 at 11:59 PM, Liu Bo wrote: > The regression is introduced to btrfs in linux v4.4 and it refuses to create > new files after log replay by returning -EEXIST. > > Although the problem is on btrfs only, there is no btrfs stuff in terms of > test, so this

Re: [PATCH 2/2] btrfs: Add unprivileged version of ino_lookup ioctl

2018-03-08 Thread Nikolay Borisov
On 6.03.2018 10:31, Misono, Tomohiro wrote: > Add unprivileged version of ino_lookup ioctl (BTRFS_IOC_INO_LOOKUP_USER) > to allow normal users to call "btrfs subvololume list/show" etc. in > combination with BTRFS_IOC_GET_SUBVOL_INFO. > > This can be used like BTRFS_IOC_INO_LOOKUP but the

[PATCH v3] fstests: btrfs/146: make sure hit all stripes in the case of compression

2018-03-08 Thread Lu Fengqi
In the case of compression, each 128K input data chunk will be compressed to 4K (because of the characters written are duplicate). Therefore we have to write (128K * 16) to make sure every stripe can be hit. Signed-off-by: Lu Fengqi --- V3: Write ($number_of_devices *

Re: [PATCH 1/2] btrfs: Add unprivileged subvolume search ioctl

2018-03-08 Thread Nikolay Borisov
On 6.03.2018 10:30, Misono, Tomohiro wrote: > Add new unprivileged ioctl (BTRFS_IOC_GET_SUBVOL_INFO) which searches > and returns only subvolume related item (ROOT_ITEM/ROOT_BACKREF/ROOT_REF) > from root tree. The arguments of this ioctl are the same as treesearch > ioctl and can be used like

Re: [PATCH v2 1/3] vsprintf: Remove accidental VLA usage

2018-03-08 Thread Rasmus Villemoes
On 2018-03-08 04:30, Kees Cook wrote: > In the quest to remove all stack VLAs from the kernel[1], this introduces > a new "simple max" macro, and changes the "sym" array size calculation to > use it. The value is actually a fixed size, but since the max() macro uses > some extensive tricks for

Re: [PATCH v2 1/3] btrfs-progs: check/lowmem: Fix the incorrect error message of check_extent_data_item

2018-03-08 Thread Qu Wenruo
On 2018年02月28日 18:13, Lu Fengqi wrote: > Instead of the disk_bytenr and disk_num_bytes of the extent_item which the > file extent references, we should output the objectid and offset of the > file extent. And the leaf may be shared by the file trees, we should print > the objectid of the root

Re: [PATCH 3/3] btrfs-progs: fsck-tests: Introduce test case with keyed data backref with the extent offset

2018-03-08 Thread Qu Wenruo
On 2018年02月28日 18:13, Lu Fengqi wrote: > Add the testcase for false alert of data extent backref lost with the > extent offset. > > The image can be reproduced by the following commands: > -- > dev=~/test.img > mnt=/mnt/btrfs > > umount $mnt &> /dev/null > fallocate -l 128M $dev > >

Re: [PATCH 2/3] btrfs-progs: check/lowmem: Fix false alert of data extent backref lost for snapshot

2018-03-08 Thread Qu Wenruo
On 2018年02月28日 18:13, Lu Fengqi wrote: > Btrfs lowmem check reports the following false alert: > -- > ERROR: file extent[267 2162688] root 256 owner 5 backref lost > -- > > The file extent is in the leaf which is shared by file tree 256 and fs > tree. > -- > leaf 30605312 items 46

Re: [PATCH v2] fstests: btrfs/146: make sure hit all stripes in the case of compression

2018-03-08 Thread Lu Fengqi
On Thu, Mar 08, 2018 at 02:10:59PM +0800, Eryu Guan wrote: >On Thu, Mar 08, 2018 at 01:56:45PM +0800, Lu Fengqi wrote: >> In the case of compression, each 128K input data chunk will be compressed >> to 4K (because of the characters written are duplicate). Therefore we have >> to write (128K * 16)