Re: How to handle a RAID5 arrawy with a failing drive? -> raid5 mostly works, just no rebuilds

2014-03-18 Thread Chris Murphy
On Mar 19, 2014, at 12:09 AM, Marc MERLIN wrote: > > 7) you can remove a drive from an array, add files, and then if you plug > the drive in, it apparently gets auto sucked in back in the array. > There is no rebuild that happens, you now have an inconsistent array where > one drive is not at

[PATCH 2/3] btrfs-progs: Fix minor problems in man page of btrfs

2014-03-18 Thread quwen...@cn.fujitsu.com
Man page of btrfs has some minor problem like: 1. Duplicant entry for "filesystem df" 2. Inconsistent parameters 3. Non-paired parens 4. Missing options 5. Wrong parameters This patch fixes these minor bug. Signed-off-by: Qu Wenruo --- man/btrfs.8.in | 184 ---

[PATCH 3/3] btrfs-progs: Modify the help string to keep consistent with man page.

2014-03-18 Thread quwen...@cn.fujitsu.com
Help string of "btrfs dev scan" is inconsistent with man page, which lacks the fact that -d|--all-device is conflict with . This patch fixes the description Signed-off-by: Qu Wenruo --- cmds-device.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cmds-device.c b/cmds-devic

[PATCH 1/3] btrfs-progs: Fix memleak in get_raid56_used()

2014-03-18 Thread quwen...@cn.fujitsu.com
Fix memleak in get_raid56_used(). Signed-off-by: Qu Wenruo --- cmds-fi-disk_usage.c | 1 + 1 file changed, 1 insertion(+) diff --git a/cmds-fi-disk_usage.c b/cmds-fi-disk_usage.c index a3b06be..2bd591d 100644 --- a/cmds-fi-disk_usage.c +++ b/cmds-fi-disk_usage.c @@ -352,6 +352,7 @@ static int g

Re: How to handle a RAID5 arrawy with a failing drive? -> raid5 mostly works, just no rebuilds

2014-03-18 Thread Marc MERLIN
On Tue, Mar 18, 2014 at 09:02:07AM +, Duncan wrote: > First just a note that you hijacked Mr Manana's patch thread. Replying (...) I did, I use mutt, I know about in Reply-To, I was tired, I screwed up, sorry, and there was no undo :) > Since you don't have to worry about the data I'd sugges

Please advise on repair action

2014-03-18 Thread Adam Khan
Hello, I have a simple btrfs located on a dm-crypt volume. I'm getting a general protection fault when I attempt to access a specific directory in Thunar file manager and in a Python program. The trace is attached for Thunar. btrfsck returns this: Checking filesystem on /dev/mapper/xyz_crypt

Re: [PATCH 5/6] Btrfs-progs: fsck: reduce memory usage of extent record struct

2014-03-18 Thread Wang Shilong
On 03/19/2014 02:18 AM, David Sterba wrote: On Tue, Mar 18, 2014 at 08:02:46PM +0800, Wang Shilong wrote: @@ -2742,7 +2742,10 @@ static int add_extent_rec(struct cache_tree *extent_cache, - rec->found_rec = extent_rec; + if (extent_rec) + rec->found_rec = 1; + el

Re: [PATCH 5/6] Btrfs-progs: fsck: reduce memory usage of extent record struct

2014-03-18 Thread David Sterba
On Tue, Mar 18, 2014 at 08:02:46PM +0800, Wang Shilong wrote: > @@ -2742,7 +2742,10 @@ static int add_extent_rec(struct cache_tree > *extent_cache, > - rec->found_rec = extent_rec; > + if (extent_rec) > + rec->found_rec = 1; > + else > + rec->found_rec = 0; I'v

[PATCH v3] xfstests: add test for btrfs send regarding directory moves/renames

2014-03-18 Thread Filipe David Borba Manana
Regression test for a btrfs incremental send issue where the kernel entered an infinite loop building a path string. This happened when either of the 2 following cases happened: 1) A directory was made a child of another directory which has a lower inode number and has a pending move/rename ope

[PATCH] Btrfs: remove unnecessary inode generation lookup in send

2014-03-18 Thread Filipe David Borba Manana
No need to search in the send tree for the generation number of the inode, we already have it in the recorded_ref structure passed to us. Signed-off-by: Filipe David Borba Manana --- fs/btrfs/send.c |9 ++--- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/fs/btrfs/send.c b

[PATCH v3] Btrfs: part 2, fix incremental send's decision to delay a dir move/rename

2014-03-18 Thread Filipe David Borba Manana
For an incremental send, fix the process of determining whether the directory inode we're currently processing needs to have its move/rename operation delayed. We were ignoring the fact that if the inode's new immediate ancestor has a higher inode number than ours but wasn't renamed/moved, we mi

Re: Please help me to contribute to btrfs project

2014-03-18 Thread Ben Gamari
Ajesh js writes: > Hi, > > I have used the btrfs filesystem in one of my projects and I have > added a small feature to it. I feel that the same feature will be > useful for others too. Hence I would like to contribute the same to > open source. > Excellent! > If everything works fine and this f

[PATCH 2/6] Btrfs-progs: fsck: fix possible memory leaks in run_next_block()

2014-03-18 Thread Wang Shilong
We still need free allocated cache memory in case error happens. Signed-off-by: Wang Shilong --- cmds-check.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmds-check.c b/cmds-check.c index c0b7f8c..b3f7e22 100644 --- a/cmds-check.c +++ b/cmds-check.c @@ -5909,6 +5909,9 @@ out:

[PATCH 4/6] Btrfs-progs: fsck: add ability to rebuild extent tree with snapshots

2014-03-18 Thread Wang Shilong
This patch makes us to rebuild a really corrupt extent tree with snapshots. To implement this, we have to verify whether a block is FULL BACKREF. This idea come from Josef Bacik: 1) We walk down the original tree, every eb we encounter has btrfs_header_owner(eb) == root->objectid. We add normal

[PATCH 5/6] Btrfs-progs: fsck: reduce memory usage of extent record struct

2014-03-18 Thread Wang Shilong
Two changes: 1.use bit filed for @found_rec 2.u32 is enough to calculate duplicate extent number. Signed-off-by: Wang Shilong --- cmds-check.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/cmds-check.c b/cmds-check.c index e1238d7..34f8fa6 100644 --

[PATCH 6/6] Btrfs-progs: fsck: fix wrong index in pick_next_pending()

2014-03-18 Thread Wang Shilong
Though all tree blocks have same size, we'd better use right index here. Signed-off-by: Wang Shilong --- cmds-check.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmds-check.c b/cmds-check.c index 34f8fa6..ebdb643 100644 --- a/cmds-check.c +++ b/cmds-check.c @@ -2928,7 +29

[PATCH 1/6] Btrfs-progs: fsck: don't free @seen cache until we finish searching

2014-03-18 Thread Wang Shilong
@seen cache is used to avoid iterating same block more than once, and we can not free them until we have finished searching. Signed-off-by: Wang Shilong --- cmds-check.c | 7 +-- 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/cmds-check.c b/cmds-check.c index d1cafe1..c0b7f8c 1

[PATCH 3/6] Btrfs-progs: fsck: deal with snapshot one by one when rebuilding extent tree

2014-03-18 Thread Wang Shilong
Previously, we deal with node block firstly and then leaf block which can maximize readahead. However, to rebuild extent tree, we need deal with snapshot one by one. This patch makes us deal with snapshot one by one if we need rebuild extent tree otherwise we drop into previous way. Signed-off-by

Re: [PATCH] Btrfs: fix a crash of clone with inline extents's split

2014-03-18 Thread Liu Bo
On Mon, Mar 17, 2014 at 03:41:31PM +0100, David Sterba wrote: > On Mon, Mar 10, 2014 at 06:56:07PM +0800, Liu Bo wrote: > > xfstests's btrfs/035 triggers a BUG_ON, which we use to detect the split > > of inline extents in __btrfs_drop_extents(). > > > > For inline extents, we cannot duplicate anot

Re: How to handle a RAID5 arrawy with a failing drive?

2014-03-18 Thread Duncan
Marc MERLIN posted on Sun, 16 Mar 2014 15:20:26 -0700 as excerpted: > Do I have other options? > (data is not important at all, I just want to learn how to deal with > such a case with the current code) First just a note that you hijacked Mr Manana's patch thread. Replying to a post and changin

Re: [PATCH 0/6 EARLY RFC] Btrfs: Get rid of whole page I/O.

2014-03-18 Thread chandan
Hello David, > I looked at previous postings of this patchset, but haven't found what > are the expected supported block sizes. > > I assume powers of two starting with 512b, until 64k. The earlier patchset posted by Chandra Seethraman was to get 4k blocksize to work with ppc64's 64k PAGE_SIZE.

Please help me to contribute to btrfs project

2014-03-18 Thread Ajesh js
Hi, I have used the btrfs filesystem in one of my projects and I have added a small feature to it. I feel that the same feature will be useful for others too. Hence I would like to contribute the same to open source. If everything works fine and this feature is not already added by somebody else,