[PATCH] btrfs: Fix extent map leak in find_first_block_group

2016-08-23 Thread Qu Wenruo
The following commit introduced the extent map leak: commit 6fb37b756acce6d6e045f79c3764206033f617b4 Author: Liu Bo Date: Wed Jun 22 18:31:27 2016 -0700 Btrfs: check inconsistence between chunk and block group This leads to slab warning at rmmod time. Cc: Liu Bo

Re: Btrfs send to send out metadata and data separately

2016-08-23 Thread Qu Wenruo
At 08/04/2016 09:52 AM, Qu Wenruo wrote: At 08/03/2016 05:05 PM, Filipe Manana wrote: On Tue, Aug 2, 2016 at 2:20 AM, Qu Wenruo wrote: At 08/02/2016 02:00 AM, Filipe Manana wrote: On Fri, Jul 29, 2016 at 1:40 PM, Qu Wenruo wrote:

Re: Will Btrfs have an official command to "uncow" existing files?

2016-08-23 Thread Darrick J. Wong
On Tue, Aug 23, 2016 at 08:48:20PM -0400, Jeff Mahoney wrote: > On 8/22/16 7:06 PM, Darrick J. Wong wrote: > > [add Dave and Christoph to cc] > > > > On Mon, Aug 22, 2016 at 04:14:19PM -0400, Jeff Mahoney wrote: > >> On 8/21/16 2:59 PM, Tomokhov Alexander wrote: > >>> Btrfs wiki FAQ gives a link

Re: BTRFS constantly reports "No space left on device" even with a huge unallocated space

2016-08-23 Thread Jeff Mahoney
On 8/22/16 5:04 PM, Ronan Arraes Jardim Chagas wrote: > Em Seg, 2016-08-22 às 14:49 -0600, Chris Murphy escreveu: >> This is really weird. I'm running 4.7.0 (Fedora) and I'm not >> experiencing problems, let alone this. What is this kernel's >> provenance? Is it a plain mainline 4.7.0 that you

Re: Will Btrfs have an official command to "uncow" existing files?

2016-08-23 Thread Jeff Mahoney
On 8/22/16 7:06 PM, Darrick J. Wong wrote: > [add Dave and Christoph to cc] > > On Mon, Aug 22, 2016 at 04:14:19PM -0400, Jeff Mahoney wrote: >> On 8/21/16 2:59 PM, Tomokhov Alexander wrote: >>> Btrfs wiki FAQ gives a link to example Python script: >>>

[PATCH v2] Btrfs: check btree node's nritems

2016-08-23 Thread Liu Bo
When btree node (level = 1) has nritems which equals to zero, we can end up with panic due to insert_ptr()'s BUG_ON(slot > nritems); where slot is 1 and nritems is 0, as copy_for_split() calls insert_ptr(.., path->slots[1] + 1, ...); A invalid value results in the whole mess, this adds the

Re: [PATCH] Btrfs: check btree node's nritems

2016-08-23 Thread Liu Bo
On Tue, Aug 16, 2016 at 06:50:00PM +0200, David Sterba wrote: > On Wed, Aug 03, 2016 at 12:57:28PM -0700, Liu Bo wrote: > > When btree node (level = 1) has nritems which equals to zero, > > we can end up with panic due to insert_ptr()'s > > > > BUG_ON(slot > nritems); > > > > where slot is 1 and

[PATCH v3] Btrfs: fix memory leak of block group cache

2016-08-23 Thread Liu Bo
While processing delayed refs, we may update block group's statistics and attach it to cur_trans->dirty_bgs, and later writing dirty block groups will process the list, which happens during btrfs_commit_transaction(). For whatever reason, the transaction is aborted and dirty_bgs is not processed

[PATCH] btrfs: Fix warning "variable ‘blocksize’ set but not used"

2016-08-23 Thread Luis Henriques
Variable 'blocksize' in reada_walk_down() is not used since commit d3e46fea1b1e ("btrfs: sink blocksize parameter to readahead_tree_block"). This patch simply removes this variable. Signed-off-by: Luis Henriques --- fs/btrfs/extent-tree.c | 2 -- 1 file changed, 2

[PATCH 1/2] btrfs: Fix warning "variable ‘gen’ set but not used"

2016-08-23 Thread Luis Henriques
Variable 'gen' in reada_for_search() is not used since commit 58dc4ce43251 ("btrfs: remove unused parameter from readahead_tree_block"). This patch simply removes this variable. Signed-off-by: Luis Henriques --- fs/btrfs/ctree.c | 2 -- 1 file changed, 2

Re: [PATCH v2] Btrfs: fix memory leak of block group cache

2016-08-23 Thread Liu Bo
Hi David, On Fri, Aug 19, 2016 at 01:28:23PM +0200, David Sterba wrote: > On Thu, Jul 21, 2016 at 02:33:19PM -0700, Liu Bo wrote: > > > > update_block_group() is the only producer to add block group cache to > > > > dirty_bgs list, and if btrfs_run_delayed_refs() aborts, the transaction > > > >

[PATCH v2] Btrfs: detect corruption when non-root leaf has zero item

2016-08-23 Thread Liu Bo
Right now we treat leaf which has zero item as a valid one because we could have an empty tree, that is, a root that is also a leaf without any item, however, in the same case but when the leaf is not a root, we can end up with hitting the BUG_ON(1) in btrfs_extend_item() called by

Re: btrfs quota issues

2016-08-23 Thread Rakesh Sankeshi
sorry, was out of the town. not much load on the system at all. As we are hitting many issues in production, just using this system for my test purpose. Built few different filesystems. 1 with LZO compression, second one with ZLIB and third one without any compression. All has issues related to

[PATCH] Btrfs: handle pending renames with recycled inodes properly

2016-08-23 Thread Josef Bacik
Suppose you have the following tree in snap1 on a file system mounted with -o inode_cache so that inode numbers are recycled └── [258] a └── [257] b and then you remove b, rename a to c, and then re-create b in c so you have the following tree └── [258] c └── [257] b

Re: Stuck btrfs-cleaner on 4.7 and 4.6

2016-08-23 Thread Jean-Denis Girard
Le 21/08/2016 à 17:39, Jean-Denis Girard a écrit : > Hi list, > > After upgrading my Fedora 23 system from 4.4.12 to 4.7.2, I'm seeing one > btrfs-cleaner process stuck at 100% CPU. The problem disappears when > going back to 4.4 kernel (4.4.17), but is also present with Fedora > kernel

Re: btrfs partition fails to mount after power outage

2016-08-23 Thread Malte Westerhoff
The output for btrfs-debug-tree –d /dev/… is quite large – so I have placed it here: https://cloud.visageimaging.com/index.php/s/Q7ILbVWFoGeckCI The –b one is this: quickstore2:~/btrfs-progs # ./btrfs-debug-tree -b 29556736 /dev/mapper/VGBIGRAID6-DATA1 btrfs-progs v4.7 parent transid verify

Re: btrfs partition fails to mount after power outage

2016-08-23 Thread Chris Murphy
On Tue, Aug 23, 2016 at 9:51 AM, Malte Westerhoff wrote: > >> btrfs-show-super -fa /d/dev/mapper/VGBIGRAID6-DATA1 > >>Where is this output? > > I had attached it as a separate file. Here it is again: Sorry, missed that there was an attachment. >

Re: btrfs partition fails to mount after power outage

2016-08-23 Thread Roman Mamedov
On Tue, 23 Aug 2016 12:30:35 + Malte Westerhoff wrote: > parent transid verify failed on 7375567323136 wanted 52059 found 52045 > parent transid verify failed on 7375567323136 wanted 52059 found 52045 > Error: could not find btree root extent for root 12974 >

Re: btrfs partition fails to mount after power outage

2016-08-23 Thread Chris Murphy
On Tue, Aug 23, 2016 at 10:05 AM, Chris Murphy wrote: >btrfs-find-root -d /dev/mapper/VGBIGRAID6-DATA1 I meant to ask for btrfs-debug-tree -d /dev/... -- Chris Murphy -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a

Re: btrfs partition fails to mount after power outage

2016-08-23 Thread Malte Westerhoff
>> btrfs-show-super -fa /dev/mapper/VGBIGRAID6-DATA1 >Where is this output? I had attached it as a separate file. Here it is again: superblock: bytenr=65536, device=/dev/mapper/VGBIGRAID6-DATA1 - csum

Re: btrfs partition fails to mount after power outage

2016-08-23 Thread Chris Murphy
On Tue, Aug 23, 2016 at 9:19 AM, Malte Westerhoff wrote: > Hi Chris, > Thanks for the response. > Yes, there is one large raid6 on which there is one LVM physical volume, > which has four logical volumes that each have a btrfs file system. > Only one of them fails

Re: btrfs partition fails to mount after power outage

2016-08-23 Thread Chris Murphy
On Tue, Aug 23, 2016 at 6:30 AM, Malte Westerhoff wrote: > Hi, > I hope this is the right list for this problem report. > > After an unclean shutdown of a server due to power outage, one of the > partitions fails to mount. > mount -o recovery ...,mount -o

Re: btrfs partition fails to mount after power outage

2016-08-23 Thread Malte Westerhoff
Hi Chris, Thanks for the response. Yes, there is one large raid6 on which there is one LVM physical volume, which has four logical volumes that each have a btrfs file system. Only one of them fails to mount, the other three are fine (data2...4). The RAID itself claims to be clean (see below).

Re: [GIT PULL] [PATCH v4 00/26] Delete CURRENT_TIME and CURRENT_TIME_SEC macros

2016-08-23 Thread Arnd Bergmann
On Monday, August 15, 2016 6:23:12 PM CEST Greg KH wrote: > On Sat, Aug 13, 2016 at 03:48:12PM -0700, Deepa Dinamani wrote: > > The series is aimed at getting rid of CURRENT_TIME and CURRENT_TIME_SEC > > macros. > > The macros are not y2038 safe. There is no plan to transition them into > >

btrfs partition fails to mount after power outage

2016-08-23 Thread Malte Westerhoff
Hi, I hope this is the right list for this problem report. After an unclean shutdown of a server due to power outage, one of the partitions fails to mount. mount -o recovery ...,mount -o recovery,ro ..., mount -o ro do not help. They produce this error in the log: [ 5464.525816] BTRFS info

Re: [PULL] Btrfs fixes for 4.8, part 2

2016-08-23 Thread Chris Mason
On Tue, Aug 23, 2016 at 01:02:37PM +0200, David Sterba wrote: On Wed, Aug 17, 2016 at 05:11:13PM +0200, David Sterba wrote: Hi, this is a short series, mostly small fixes that did not make it to the first round. Please pull, thanks. As you did not pick this pull request, I'll prepare another

Re: [PATCH] Btrfs: fix em leak in find_first_block_group

2016-08-23 Thread David Sterba
On Fri, Aug 19, 2016 at 10:31:53AM -0700, Omar Sandoval wrote: > On Thu, Aug 18, 2016 at 03:30:06PM -0400, Josef Bacik wrote: > > We need to call free_extent_map() on the em we look up.Btrfs: fix em leak in > > find_first_block_group > > Something weird happened with your patch here ^^^ Fixed.

Re: [PATCH] btrfs: don't create or leak aliased root while cleaning up orphans

2016-08-23 Thread David Sterba
On Wed, Aug 17, 2016 at 09:58:33PM -0400, Jeff Mahoney wrote: > commit 909c3a22da3 (Btrfs: fix loading of orphan roots leading to BUG_ON) > avoids the BUG_ON but can add an aliased root to the dead_roots list or > leak the root. > > Since we've already been loading roots into the radix tree, we

Re: [PULL] Btrfs fixes for 4.8, part 2

2016-08-23 Thread David Sterba
On Wed, Aug 17, 2016 at 05:11:13PM +0200, David Sterba wrote: > Hi, > > this is a short series, mostly small fixes that did not make it to the first > round. Please pull, thanks. As you did not pick this pull request, I'll prepare another one with more patches, based on this branch. -- To

Re: Will Btrfs have an official command to "uncow" existing files?

2016-08-23 Thread Austin S. Hemmelgarn
On 2016-08-22 22:43, Chris Murphy wrote: On Mon, Aug 22, 2016 at 5:06 PM, Darrick J. Wong wrote: [add Dave and Christoph to cc] On Mon, Aug 22, 2016 at 04:14:19PM -0400, Jeff Mahoney wrote: On 8/21/16 2:59 PM, Tomokhov Alexander wrote: Btrfs wiki FAQ gives a link to

[PATCH 04/13] btrfs-progs: mkfs: do not scan partially initialized devices

2016-08-23 Thread David Sterba
We call scan ioctl on the devices too early, when most of the filesystem structures are not yet created. Move the registration to the end, after the filesystem gets closed. Signed-off-by: David Sterba --- mkfs.c | 15 +-- 1 file changed, 9 insertions(+), 6

[PATCH 00/13] Btrfs-progs: partial mkfs/convert, error handling, cleanups

2016-08-23 Thread David Sterba
Hi, this series mainly improves error handling in mkfs and convert, plus the collaterals. There were too many BUG_ONs, now there are 0 in mkfs.c. There's still work to do, eg. in the generic functions. The improvement idea is to be able to safely leave around an unfinished filesystem image, so

[PATCH 11/13] btrfs-progs: mkfs: handle and report transaction commit failures

2016-08-23 Thread David Sterba
Signed-off-by: David Sterba --- mkfs.c | 18 +++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/mkfs.c b/mkfs.c index c28a8bb7e983..f063323903dc 100644 --- a/mkfs.c +++ b/mkfs.c @@ -1063,7 +1063,11 @@ static int make_image(char *source_dir, struct

[PATCH 02/13] btrfs-progs: make superblock reading/scanning api more generic

2016-08-23 Thread David Sterba
We'll add more modes that affect scanning. Signed-off-by: David Sterba --- chunk-recover.c | 8 +--- cmds-filesystem.c | 2 +- disk-io.c | 25 + disk-io.h | 13 +++-- super-recover.c | 3 ++- utils.c | 5

[PATCH 09/13] btrfs-progs: document all btrfs_open_ctree_flags

2016-08-23 Thread David Sterba
Document and add unsigned type to the values. Signed-off-by: David Sterba --- disk-io.h | 41 + 1 file changed, 25 insertions(+), 16 deletions(-) diff --git a/disk-io.h b/disk-io.h index a73dede1e8d0..c404d3f4fdfe 100644 --- a/disk-io.h

[PATCH 07/13] btrfs-progs: mkfs: improve error handling in main()

2016-08-23 Thread David Sterba
Signed-off-by: David Sterba --- mkfs.c | 49 +++-- 1 file changed, 35 insertions(+), 14 deletions(-) diff --git a/mkfs.c b/mkfs.c index b2baf47bb595..94b349f157ca 100644 --- a/mkfs.c +++ b/mkfs.c @@ -1805,7 +1805,10 @@ int main(int

[PATCH 06/13] btrfs-progs: mkfs: return errors from block group creation functions

2016-08-23 Thread David Sterba
No more BUG_ONs, we don't care about cleanup as the filesystem is supposed to be marked as partial. Signed-off-by: David Sterba --- mkfs.c | 75 ++ 1 file changed, 48 insertions(+), 27 deletions(-) diff --git

[PATCH 08/13] btrfs-progs: mkfs: improve error handling in recow_roots

2016-08-23 Thread David Sterba
Return and handle errors in the callchain. Signed-off-by: David Sterba --- mkfs.c | 42 ++ 1 file changed, 30 insertions(+), 12 deletions(-) diff --git a/mkfs.c b/mkfs.c index 94b349f157ca..3f0a3322cc76 100644 --- a/mkfs.c +++ b/mkfs.c

[PATCH 01/13] btrfs-progs: pass OPEN_CTREE flags as unsigned

2016-08-23 Thread David Sterba
As we're passing a set of flags, the enum type is not appropriate. Signed-off-by: David Sterba --- btrfstune.c | 2 +- cmds-check.c | 2 +- disk-io.c| 12 ++-- disk-io.h| 8 4 files changed, 12 insertions(+), 12 deletions(-) diff --git

[PATCH 03/13] btrfs-progs: introduce signature for a partially set up filesystem

2016-08-23 Thread David Sterba
Currently the superblock is created first, with a valid signaure, but the rest of the filesystem is missing. When the creation process is interrupted, the filesystem still might be considered as valid. To prevent that, create the filesytem with an invalid signature that would be still recognized

[PATCH 10/13] btrfs-progs: mkfs: switch BUG_ON to error handling in traverse_directory

2016-08-23 Thread David Sterba
Signed-off-by: David Sterba --- mkfs.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/mkfs.c b/mkfs.c index 3f0a3322cc76..c28a8bb7e983 100644 --- a/mkfs.c +++ b/mkfs.c @@ -910,7 +910,12 @@ static int traverse_directory(struct btrfs_trans_handle

[PATCH 05/13] btrfs-progs: two staged filesystem creation

2016-08-23 Thread David Sterba
The filesystem existence on a device is manifested by the signature, during the mkfs process we write it first and then create other structures. Such filesystem is not valid and should not be registered during device scan nor listed among devices from blkid. This patch will introduce two staged

[PATCH 13/13] btrfs-progs: mkfs: clean up make_image

2016-08-23 Thread David Sterba
The exact errors are printed, the removed message does not seem to be necessary. Return proper errors. Signed-off-by: David Sterba --- mkfs.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/mkfs.c b/mkfs.c index ef0b099a58d7..2aa1d5d31523 100644 ---

[PATCH 12/13] btrfs-progs: mkfs: help and usage now to to stdout

2016-08-23 Thread David Sterba
Signed-off-by: David Sterba --- mkfs.c | 38 +++--- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/mkfs.c b/mkfs.c index f063323903dc..ef0b099a58d7 100644 --- a/mkfs.c +++ b/mkfs.c @@ -344,31 +344,31 @@ static int

Re: [lkp] [btrfs] 994cdc1331: WARNING: CPU: 0 PID: 14378 at fs/btrfs/extent-tree.c:10030 btrfs_free_block_groups+0x29b/0x420 [btrfs]

2016-08-23 Thread Wang Xiaoguang
Hi, On 08/23/2016 03:45 PM, kernel test robot wrote: FYI, we noticed the following commit: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master commit 994cdc133173fd9d69eae45cd228eec21dbed080 ("btrfs: update btrfs_space_info's bytes_may_use timely") in testcase:

Re: [Regression/Behavior change]dm-flakey corrupt read bio, even the feature is drop_writes

2016-08-23 Thread Qu Wenruo
At 08/22/2016 11:07 PM, Mike Snitzer wrote: On Mon, Aug 22 2016 at 4:05am -0400, Lukas Herbolt wrote: Hello, There is patch from Mike. It's part of current pull request to 4.8-rc1 For more details check: -

Re: [dm-devel] [Regression/Behavior change]dm-flakey corrupt read bio, even the feature is drop_writes

2016-08-23 Thread Qu Wenruo
Hi Lukas, Thanks for your patch, while I am a little concerned of it, even I'm a newbie to flakey code. At 08/22/2016 10:53 PM, Lukas Herbolt wrote: Hi Qu, Sorry for the confusion. Reading the email again and the code it seems that the READS are really returned as -EIO if you set the