[RFC - PATCH] btrfs: do not write corrupted metadata blocks to disk

2016-02-21 Thread Alex Lyakas
csum_dirty_buffer was issuing a warning in case the extent buffer did not look alright, but was still returning success. Let's return error in this case, and also add two additional sanity checks on the extent buffer header. We had btrfs metadata corruption, and after looking at the logs we saw t

Re: [Question]: Contributing to btrfs

2016-02-21 Thread Duncan
Philippe Loctaux posted on Sat, 20 Feb 2016 23:40:50 +0100 as excerpted: > I'm new to the mailing list and btrfs in general (I've been using it for > two weeks on my new arch install) and I'd like to contribute to the code > :) > > I know how to work w/ git and patches, I just wanted to know whic

Re: random i/o error without error in dmesg

2016-02-21 Thread Philipp Serr
On Mon, 2 Nov 2015 19:26:01 +0100, Szalma László wrote: Unfortunately the problem with kernel 4.3.0 still exists. Any news on that issue? I'm currently @ 4.3.3 and the issue persists for me, too. There's one more information I might be able to contribute: In my case always the same single

[PATCH] Btrfs: async: fixed a brace coding style issue

2016-02-21 Thread Philippe Loctaux
Fixed a coding style issue. Signed-off-by: Philippe Loctaux --- fs/btrfs/async-thread.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/btrfs/async-thread.c b/fs/btrfs/async-thread.c index 5fb60ea..7914dd2 100644 --- a/fs/btrfs/async-thread.c +++ b/fs/btrfs/async-threa

Re: [PATCH] Btrfs: async: fixed a brace coding style issue

2016-02-21 Thread Simon Quigley
On 02/21/2016 02:50 PM, Philippe Loctaux wrote: Fixed a coding style issue. Signed-off-by: Philippe Loctaux --- fs/btrfs/async-thread.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/btrfs/async-thread.c b/fs/btrfs/async-thread.c index 5fb60ea..7914dd2 100644 --

Re: [PATCH] Btrfs: async: fixed a brace coding style issue

2016-02-21 Thread Philippe Loctaux
On Sun, Feb 21, 2016 at 03:08:02PM -0600, Simon Quigley wrote: > I thought I proposed this exact patch...hmm... Yes you're right, I wasn't subscribed at the mailing list yet. The maintainer will probably see it's a duplicate and he'll just ignore that patch. -- Philippe Loctaux p...@philippelocta

[PATCH] Btrfs: check-integrity: fixed a comment block coding style issue

2016-02-21 Thread Philippe Loctaux
Makes the comment block start with /* on a separate line, and end with */ on a separate line as well. Signed-off-by: Philippe Loctaux --- fs/btrfs/check-integrity.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fs/btrfs/check-integrity.c b/fs/btrfs/check-integrity.c i

[PATCH] Btrfs: check-integrity: fixed comment blocks coding style issues

2016-02-21 Thread Philippe Loctaux
Makes the comment blocks start with /* on separate lines, and end with */ on separate lines as well. Signed-off-by: Philippe Loctaux --- fs/btrfs/check-integrity.c | 30 ++ 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/fs/btrfs/check-integrity.c b/fs/

[PATCH] Btrfs: compression: added line after variable declaration

2016-02-21 Thread Philippe Loctaux
Added line after variable declaration, fixing checkpatch warning. Signed-off-by: Philippe Loctaux --- fs/btrfs/compression.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/btrfs/compression.c b/fs/btrfs/compression.c index 3346cd8..5194b6f 100644 --- a/fs/btrfs/compression.c +++ b/fs/btr

[PATCH] Btrfs: ctree: added lines after variable declarations

2016-02-21 Thread Philippe Loctaux
Added lines after variable declarations, fixing 22 checkpatch warnings. Signed-off-by: Philippe Loctaux --- fs/btrfs/ctree.c | 23 +++ 1 file changed, 23 insertions(+) diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c index 769e0ff..c9fd42d 100644 --- a/fs/btrfs/ctree.c +++ b

Re: [PATCH] Btrfs: ctree: added lines after variable declarations

2016-02-21 Thread Joe Perches
On Mon, 2016-02-22 at 00:46 +0100, Philippe Loctaux wrote: > Added lines after variable declarations, fixing 22 checkpatch warnings. [] > diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c [] > @@ -4592,6 +4610,7 @@ void btrfs_truncate_item(struct btrfs_root *root, > struct btrfs_path *path, >  

[PATCH] Btrfs: delayed-inode: Fixed indentation coding style issue

2016-02-21 Thread Philippe Loctaux
Use tabs instead of spaces, fixing checkpatch error. Signed-off-by: Philippe Loctaux --- fs/btrfs/delayed-inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/btrfs/delayed-inode.c b/fs/btrfs/delayed-inode.c index b57daa8..2e25aa54 100644 --- a/fs/btrfs/delayed-inode.c

Re: [PATCH] Btrfs: ctree: added lines after variable declarations

2016-02-21 Thread Joe Perches
On Mon, 2016-02-22 at 01:01 +0100, Philippe Loctaux wrote: > Is there no need of additional blank line here particulary > or in all lines that I changed? Please don't top post and just here. > On Sun, Feb 21, 2016 at 03:53:04PM -0800, Joe Perches wrote: > > On Mon, 2016-02-22 at 00:46 +0100, Phili

Re: [PATCH] Btrfs: ctree: added lines after variable declarations

2016-02-21 Thread Philippe Loctaux
Is there no need of additional blank line here particulary or in all lines that I changed? -- Philippe Loctaux p...@philippeloctaux.com On Sun, Feb 21, 2016 at 03:53:04PM -0800, Joe Perches wrote: > On Mon, 2016-02-22 at 00:46 +0100, Philippe Loctaux wrote: > > Added lines after variable declarat

[PATCH 1/2] Btrfs: dev-replace: Fixed indentation coding style issues

2016-02-21 Thread Philippe Loctaux
Use tabs instead of spaces, fixing 3 checkpatch errors. Signed-off-by: Philippe Loctaux --- fs/btrfs/dev-replace.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/btrfs/dev-replace.c b/fs/btrfs/dev-replace.c index cbb7dbf..b89a8c6 100644 --- a/fs/btrfs/dev-replace.c

Re: [PATCH] Btrfs: ctree: added lines after variable declarations

2016-02-21 Thread Philippe Loctaux
Hi, I'm really sorry, but I don't understand what you're trying to mean. Could you simplify your sentence please (since I'm not english native)? I'd really apreciate that, thanks :) -- Philippe Loctaux p...@philippeloctaux.com On Sun, Feb 21, 2016 at 04:06:03PM -0800, Joe Perches wrote: > On Mon,

[PATCH 2/2] Btrfs: dev-replace: fixed comment blocks coding style issues

2016-02-21 Thread Philippe Loctaux
Makes the comment blocks start with /* on separate lines, and end with */ on separate lines as well. Signed-off-by: Philippe Loctaux --- fs/btrfs/dev-replace.c | 12 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/fs/btrfs/dev-replace.c b/fs/btrfs/dev-replace.c index b

Re: [PATCH] Btrfs: compression: added line after variable declaration

2016-02-21 Thread Joe Perches
On Mon, 2016-02-22 at 00:26 +0100, Philippe Loctaux wrote: > Added line after variable declaration, fixing checkpatch warning. [] > diff --git a/fs/btrfs/compression.c b/fs/btrfs/compression.c [] > @@ -522,6 +522,7 @@ static noinline int add_ra_bio_pages(struct inode *inode, >   >  

Re: [PATCH] Btrfs: compression: added line after variable declaration

2016-02-21 Thread Philippe Loctaux
Oh, I see now :) I'll try your changes and tell if they work or not :) -- Philippe Loctaux p...@philippeloctaux.com On Sun, Feb 21, 2016 at 04:37:54PM -0800, Joe Perches wrote: > On Mon, 2016-02-22 at 00:26 +0100, Philippe Loctaux wrote: > > Added line after variable declaration, fixing checkpat

Re: [PATCH] Btrfs: ctree: added lines after variable declarations

2016-02-21 Thread Joe Perches
On Mon, 2016-02-22 at 01:31 +0100, Philippe Loctaux wrote: > Hi, > I'm really sorry, but I don't understand what you're trying to mean. > Could you simplify your sentence please (since I'm not english > native)? > I'd really apreciate that, thanks :) Please do not put your reply at the top of the

Re: [RFC - PATCH] btrfs: do not write corrupted metadata blocks to disk

2016-02-21 Thread Filipe Manana
On Sun, Feb 21, 2016 at 3:36 PM, Alex Lyakas wrote: > csum_dirty_buffer was issuing a warning in case the extent buffer > did not look alright, but was still returning success. > Let's return error in this case, and also add two additional sanity > checks on the extent buffer header. > > We had bt

Re: [Question]: Contributing to btrfs

2016-02-21 Thread Qu Wenruo
Philippe Loctaux wrote on 2016/02/20 23:40 +0100: Hello! I'm new to the mailing list and btrfs in general (I've been using it for two weeks on my new arch install) and I'd like to contribute to the code :) I know how to work w/ git and patches, I just wanted to know which git repo I need to c

[PATCH 0/5] btrfs-find-root enhancement for chunk tree corrupted fs

2016-02-21 Thread Qu Wenruo
Before this patchset, btrfs-find-root needs valid chunk tree from the fs. However for chunk root corrupted case, btrfs-find-root is of no use due to above limitation. This patchset will allow open_ctree_fs_info() to return a fs_info without any valid tree root, but system chunk map from superblock

[PATCH 3/5] btrfs: Add support for tree block operations on fs_info without roots.

2016-02-21 Thread Qu Wenruo
Since open_ctree_fs_info() now may return a fs_info even without any roots, modify functions like read_tree_block() to operate with such fs_info. This provides the basis for btrfs-find-root to operate on chunk tree corrupted fs. Signed-off-by: Qu Wenruo --- btrfs-corrupt-block.c | 2 +- disk-i

[PATCH 2/5] btrfs: Allow open_ctree to return fs_info even chunk tree is corrupted

2016-02-21 Thread Qu Wenruo
Current open_ctree_fs_info() won't return anything if chunk tree root is corrupted. This makes some function, like btrfs-find-root unable to find any older chunk tree root, even it is possible to use system_chunk_array in super block. And at least two users in mail list has reported such heavily c

[PATCH 4/5] btrfs: find-root: Allow btrfs-find-root to search chunk root even chunk root is corrupted

2016-02-21 Thread Qu Wenruo
Since now open_ctree_fs_info() can even return a valid fs_info with only system chunk mapping from super block, use this ability to do chunk root search for heavily damanged fs. As an fast alternative for time consuming and buggy chunk-recovery. Signed-off-by: Qu Wenruo --- btrfs-find-root.c |

[PATCH 5/5] btrfs: misc-test: Add regression test for find-root gives empty result

2016-02-21 Thread Qu Wenruo
Add regression test for btrfs-find-root gives empty result even the fs is OK. Signed-off-by: Qu Wenruo --- .../first_meta_chunk.btrfs-image| Bin 0 -> 4096 bytes tests/misc-tests/012-find-root-no-result/test.sh| 20 2 files changed, 20 insertions(+)

[PATCH 1/5] btrfs: volume: Fix a bug causing btrfs-find-root to skip first chunk

2016-02-21 Thread Qu Wenruo
There is a small bug from 2011, where btrfs_next_bg (formally btrfs_next_metadata) function will always skip the first chunk. That's OK for that time, as there is always 3 empty temporary chunks. But now, we may ended up with only one metadata or system chunk, with empty chunk auto-remove from ker

Re: [PATCH 0/5] btrfs-find-root enhancement for chunk tree corrupted fs

2016-02-21 Thread Qu Wenruo
This patchset can also be fetched from github: https://github.com/adam900710/btrfs-progs.git syschunk_find_root_20160222 Thanks, Qu Qu Wenruo wrote on 2016/02/22 14:59 +0800: Before this patchset, btrfs-find-root needs valid chunk tree from the fs. However for chunk root corrupted case, btrfs-f

Re: [Question]: Contributing to btrfs

2016-02-21 Thread Qu Wenruo
Philippe Loctaux wrote on 2016/02/22 08:26 +0100: On Mon, Feb 22, 2016 at 09:18:04AM +0800, Qu Wenruo wrote: https://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs.git For branch, normally I use 'integration-X.X' as base for kernel development. And for btrfs-progs, https://github.c

Re: [Question]: Contributing to btrfs

2016-02-21 Thread Philippe Loctaux
On Mon, Feb 22, 2016 at 09:18:04AM +0800, Qu Wenruo wrote: > https://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs.git > For branch, normally I use 'integration-X.X' as base for kernel development. > > And for btrfs-progs, > https://github.com/kdave/btrfs-progs.git devel Allright, I'l