[PATCH 03/14] btrfs: dedup: Introduce function to add hash into in-memory tree

2015-12-29 Thread Qu Wenruo
From: Wang Xiaoguang Introduce static function inmem_add() to add hash into in-memory tree. And now we can implement the btrfs_dedup_add() interface. Signed-off-by: Wang Xiaoguang --- fs/btrfs/dedup.c | 116 +++ 1 file changed, 116 insertions

[PATCH 01/14] btrfs: dedup: Introduce dedup framework and its header

2015-12-29 Thread Qu Wenruo
From: Wang Xiaoguang Introduce the header for btrfs online(write time) de-duplication framework and needed header. The new de-duplication framework is going to support 2 different dedup method and 1 dedup hash. Signed-off-by: Qu Wenruo Signed-off-by: Wang Xiaoguang --- fs/btrfs/ctree.h | 3

[PATCH 1/7] btrfs-progs: Basic framework for dedup command group

2015-12-29 Thread Qu Wenruo
Add basic ioctl header and command group framework for later use. Alone with basic man page doc. Signed-off-by: Qu Wenruo --- Documentation/btrfs-dedup.asciidoc | 37 + Makefile.in| 2 +- btrfs.c| 1 + cmds-dedup.c

[PATCH 6/7] btrfs: dedup: Add show-super support for new DEDUP flag

2015-12-29 Thread Qu Wenruo
Now btrfs-show-super can handle DEDUP ro compat flag. Signed-off-by: Qu Wenruo --- btrfs-show-super.c | 17 + 1 file changed, 17 insertions(+) diff --git a/btrfs-show-super.c b/btrfs-show-super.c index d8ad69e..7c0dfa9 100644 --- a/btrfs-show-super.c +++ b/btrfs-show-super.c @@

[PATCH 2/7] btrfs-progs: dedup: Add enable command for dedup command group

2015-12-29 Thread Qu Wenruo
Add enable subcommand for dedup commmand group. Signed-off-by: Qu Wenruo --- Documentation/btrfs-dedup.asciidoc | 62 ++- cmds-dedup.c | 120 + ioctl.h| 2 + kerncompat.h

[PATCH 0/7] btrfs-progs: Support for in-band deduplication

2015-12-29 Thread Qu Wenruo
Preparation patchset for in-coming (aimed for 4.6) kernel in-band de-duplication patchset. New kernel dedup will has 2 different dedup backends and a ioctl interface to enable/disable dedup. The ioctl interface and on-disk format (mostly) is determined, so submit this patchset first before de-dup

[PATCH v2 00/14][For 4.6] Btrfs: Add inband (write time) de-duplication framework

2015-12-29 Thread Qu Wenruo
This updated version of inband de-duplication has the following features: 1) ONE unified dedup framework. Most of its code is hidden quietly in dedup.c and export the minimal interfaces for its caller. Reviewer and further developer would benefit from the unified framework. 2) TWO diff

[PATCH 11/14] btrfs: dedup: Add support for on-disk hash search

2015-12-29 Thread Qu Wenruo
Now on-disk backend should be able to search hash now. Signed-off-by: Wang Xiaoguang Signed-off-by: Qu Wenruo --- fs/btrfs/dedup.c | 169 ++- fs/btrfs/dedup.h | 3 + 2 files changed, 171 insertions(+), 1 deletion(-) diff --git a/fs/btrfs/de

[PATCH 06/14] btrfs: dedup: Implement btrfs_dedup_calc_hash interface

2015-12-29 Thread Qu Wenruo
From: Wang Xiaoguang Unlike in-memory or on-disk dedup method, only SHA256 hash method is supported yet, so implement btrfs_dedup_calc_hash() interface using SHA256. Signed-off-by: Qu Wenruo Signed-off-by: Wang Xiaoguang --- fs/btrfs/dedup.c | 57 ++

[PATCH 05/14] btrfs: dedup: Introduce function to search for an existing hash

2015-12-29 Thread Qu Wenruo
From: Wang Xiaoguang Introduce static function inmem_search() to handle the job for in-memory hash tree. The trick is, we must ensure the delayed ref head is not being run at the time we search the for the hash. With inmem_search(), we can implement the btrfs_dedup_search() interface. Signed-o

[PATCH 4/7] btrfs-progs: dedup: Add status subcommand

2015-12-29 Thread Qu Wenruo
Add status subcommand for dedup command group. Signed-off-by: Qu Wenruo --- Documentation/btrfs-dedup.asciidoc | 3 ++ cmds-dedup.c | 72 ++ 2 files changed, 75 insertions(+) diff --git a/Documentation/btrfs-dedup.asciidoc b/Documentat

[PATCH 02/14] btrfs: dedup: Introduce function to initialize dedup info

2015-12-29 Thread Qu Wenruo
From: Wang Xiaoguang Add generic function to initialize dedup info. Signed-off-by: Qu Wenruo Signed-off-by: Wang Xiaoguang --- fs/btrfs/Makefile | 2 +- fs/btrfs/dedup.c | 96 +++ fs/btrfs/dedup.h | 14 ++-- 3 files changed, 109 inser

[PATCH 07/14] btrfs: ordered-extent: Add support for dedup

2015-12-29 Thread Qu Wenruo
From: Wang Xiaoguang Add ordered-extent support for dedup. Note, current ordered-extent support only supports non-compressed source extent. Support for compressed source extent will be added later. Signed-off-by: Qu Wenruo Signed-off-by: Wang Xiaoguang --- fs/btrfs/ordered-data.c | 33 ++

[PATCH 7/7] btrfs-progs: dedup-tree: Add dedup tree support

2015-12-29 Thread Qu Wenruo
Add dedup tree support for btrfs-debug-tree. Signed-off-by: Qu Wenruo --- btrfs-debug-tree.c | 4 ctree.h| 7 +++ print-tree.c | 52 3 files changed, 63 insertions(+) diff --git a/btrfs-debug-tree.c b/btrfs-debug-

[PATCH 5/7] btrfs-progs: Add dedup feature for mkfs and convert

2015-12-29 Thread Qu Wenruo
Add new DEDUP ro compat flag and corresponding mkfs/convert flag 'dedup'. Since dedup tree is completely isolated from fs tree, so even old kernel could do read mount. So add it to RO compat flag instead of common incompat flags Signed-off-by: Qu Wenruo --- Documentation/mkfs.btrfs.asciidoc |

[PATCH 13/14] btrfs: dedup: Add support to delete hash for on-disk backend

2015-12-29 Thread Qu Wenruo
Now on-disk backend can delete hash now. Signed-off-by: Wang Xiaoguang Signed-off-by: Qu Wenruo --- fs/btrfs/dedup.c | 54 ++ 1 file changed, 54 insertions(+) diff --git a/fs/btrfs/dedup.c b/fs/btrfs/dedup.c index 82e21a6..704c3c7 100644 ---

[PATCH 10/14] btrfs: dedup: Introduce interfaces to resume and cleanup dedup info

2015-12-29 Thread Qu Wenruo
Since we will introduce a new on-disk based dedup method, introduce new interfaces to resume previous dedup setup. And since we introduce a new tree for status, also add disable handler for it. Signed-off-by: Wang Xiaoguang Signed-off-by: Qu Wenruo --- fs/btrfs/dedup.c | 193

[PATCH 14/14] btrfs: dedup: Add ioctl for inband deduplication

2015-12-29 Thread Qu Wenruo
From: Wang Xiaoguang Add ioctl interface for inband deduplication, which includes: 1) enable 2) disable 3) status We will later add ioctl to disable inband dedup for given file/dir. Signed-off-by: Qu Wenruo Signed-off-by: Wang Xiaoguang --- fs/btrfs/ctree.h | 1 + fs/btrfs/disk-io

[PATCH 12/14] btrfs: dedup: Add support for adding hash for on-disk backend

2015-12-29 Thread Qu Wenruo
Now on-disk backend can add hash now. Signed-off-by: Wang Xiaoguang Signed-off-by: Qu Wenruo --- fs/btrfs/dedup.c | 69 1 file changed, 69 insertions(+) diff --git a/fs/btrfs/dedup.c b/fs/btrfs/dedup.c index bebf180..82e21a6 100644 --- a

[PATCH 09/14] btrfs: dedup: Add basic tree structure for on-disk dedup method

2015-12-29 Thread Qu Wenruo
Introduce a new tree, dedup tree to record on-disk dedup hash. As a persist hash storage instead of in-memeory only implement. Unlike Liu Bo's implement, in this version we won't do hack for bytenr -> hash search, but add a new type, DEDUP_BYTENR_ITEM for such search case, just like in-memory back

[PATCH 08/14] btrfs: dedup: Inband in-memory only de-duplication implement

2015-12-29 Thread Qu Wenruo
From: Wang Xiaoguang Core implement for inband de-duplication. It reuse the async_cow_start() facility to do the calculate dedup hash. And use dedup hash to do inband de-duplication at extent level. The work flow is as below: 1) Run delalloc range for an inode 2) Calculate hash for the delalloc

[PATCH 04/14] btrfs: dedup: Introduce function to remove hash from in-memory tree

2015-12-29 Thread Qu Wenruo
From: Wang Xiaoguang Introduce static function inmem_del() to remove hash from in-memory dedup tree. And implement btrfs_dedup_del() and btrfs_dedup_destroy() interfaces. Signed-off-by: Qu Wenruo Signed-off-by: Wang Xiaoguang --- fs/btrfs/dedup.c | 77 +

[PATCH 3/7] btrfs-progs: dedup: Add disable support for inban deduplication

2015-12-29 Thread Qu Wenruo
Add disable subcommand for dedup command group. Signed-off-by: Qu Wenruo --- Documentation/btrfs-dedup.asciidoc | 5 + cmds-dedup.c | 42 ++ 2 files changed, 47 insertions(+) diff --git a/Documentation/btrfs-dedup.asciidoc b/Docume

[BUG] unable to handle kernel NULL pointer dereference when removing device

2015-12-29 Thread Juan Orti Alcaine
Hello, I've hit this bug when removing the device /dev/mapper/vg_hd04-lv_btrfs_hd04 from this filesystem. The only peculiarity is that it mixes partitions and a lvm logical volume. The device was removed successfully and no further errors have been seen. # btrfs fi show Label: 'btrfs_raid1' uuid

Re: [PATCH v3 2/2] btrfs: Enhance chunk validation check

2015-12-29 Thread Chandan Rajendra
On Tuesday 08 Dec 2015 16:40:42 Qu Wenruo wrote: > Enhance chunk validation: > 1) Num_stripes >We already have such check but it's only in super block sys chunk >array. >Now check all on-disk chunks. > > 2) Chunk logical >It should be aligned to sector size. >This behavior shou

Re: Deadlock after upgrade to 4.1

2015-12-29 Thread Rich Freeman
On Fri, Dec 25, 2015 at 11:34 PM, Chris Murphy wrote: > I would then also try to reproduce with 4.2.8 or 4.3.3 because those > have ~ 25% backports than made it to 4.1.15, so there's an off chance > it's fixed there. I take it that those backports are in the queue though? I was actually thinking

Re: [PATCH] BTRFS: Adds an option to select RAID Stripe size

2015-12-29 Thread David Sterba
On Mon, Dec 28, 2015 at 07:24:11AM -0500, Sanidhya Solanki wrote: > An option to select the RAID Stripe size is made > available in the BTRFS Filesystem, via an option > in the BTRFS Config setup, with minimal change > to the existing code base. The stripe size depends on how the filesystem was ma

Re: [PATCH] BTRFS: Adds an option to select RAID Stripe size

2015-12-29 Thread Sanidhya Solanki
On Tue, 29 Dec 2015 14:39:07 +0100 David Sterba wrote: > The stripe size depends on how the filesystem was made, at the moment > the stripesize parameter is missing from mkfs. The kernel module > should support all sizes at runtime, so it's not a compile-time > option. No good? I will try and re

Re: [PATCH] BTRFS: Adds an option to select RAID Stripe size

2015-12-29 Thread Christoph Anton Mitterer
On Mon, 2015-12-28 at 21:23 -0500, Sanidhya Solanki wrote: > From Documentation/filesystems/BTRFS.txt: > Btrfs is under heavy development, and is not suitable for > any uses other than benchmarking and review. Well I guess now it's time for Duncan's usual "stable or not" talk (@Duncan, I think by n

Re: [PATCH] BTRFS: Adds an option to select RAID Stripe size

2015-12-29 Thread Duncan
Christoph Anton Mitterer posted on Tue, 29 Dec 2015 16:32:59 +0100 as excerpted: >> From Documentation/filesystems/BTRFS.txt: >> Btrfs is under heavy development, and is not suitable for any uses >> other than benchmarking and review. > Well I guess now it's time for Duncan's usual "stable or not

Re: [PATCH] BTRFS: Adds an option to select RAID Stripe size

2015-12-29 Thread David Sterba
On Tue, Dec 29, 2015 at 06:15:12AM -0500, Sanidhya Solanki wrote: > On Tue, 29 Dec 2015 14:39:07 +0100 > David Sterba wrote: > > > The stripe size depends on how the filesystem was made, at the moment > > the stripesize parameter is missing from mkfs. The kernel module > > should support all size

Re: should btrfsck fix a bad superblock?

2015-12-29 Thread David Sterba
On Tue, Dec 29, 2015 at 02:28:19AM +, Duncan wrote: > Btrfs check's -s option simply lets you use a different superblock. I > don't believe check is designed to actually fix superblocks, tho I guess > with --repair it fixes certain bad fields in them. The superblock is a special type of met

Re: [PATCH] BTRFS: Adds an option to select RAID Stripe size

2015-12-29 Thread David Sterba
On Tue, Dec 29, 2015 at 05:26:28AM +0100, Christoph Anton Mitterer wrote: > On Mon, 2015-12-28 at 19:03 -0500, Sanidhya Solanki wrote: > > That sounds like an absolutely ghastly idea. > *G* and it probably is ;) > > > > Lots of potential for > > mistakes and potential data loss. I take up the of

Re: [PATCH v4 6/9] Btrfs: implement the free space B-tree

2015-12-29 Thread Chris Mason
On Tue, Sep 29, 2015 at 08:50:35PM -0700, Omar Sandoval wrote: > From: Omar Sandoval > > The free space cache has turned out to be a scalability bottleneck on > large, busy filesystems. When the cache for a lot of block groups needs > to be written out, we can get extremely long commit times; if

Re: Btrfs scrub failure for raid 6 kernel 4.3

2015-12-29 Thread Waxhead
Chris Murphy wrote: On Mon, Dec 28, 2015 at 3:55 PM, Waxhead wrote: I tried the following btrfs-image -t4 -c9 /dev/sdb1 /btrfs_raid6.img checksum verify failed on 28734324736 found C3E98F3B wanted EB2392C6 checksum verify failed on 28734324736 found C3E98F3B wanted EB2392C6 checksum ver

Re: Trouble with broken RAID5/6 System after trying to solve a problem, want to recover contained Data

2015-12-29 Thread Alistair Grant
On Tue, Dec 29, 2015 at 7:16 AM, Christian wrote: > I found out, that i can also show more Information about Files and Diretories > contained in the Filesystem. > > btrfs-debug-tree show me the following Infos: > > parent transid verify failed on 2234958286848 wanted 35674 found 35675 > parent tr

Re: btrfs check inconsistency with raid1, part 1

2015-12-29 Thread Chris Murphy
Latest update on this thread. btrfs check (4.3.1) reports no problems. Volume mounts with kernel 4.2.8 with no errors. And I just did a scrub and there were no errors, not even any fix up messages. And dev stats are all zero. So... it appears it was a minor enough problem, and still consistent eno

Re: [PATCH] BTRFS: Adds an option to select RAID Stripe size

2015-12-29 Thread Sanidhya Solanki
On Tue, 29 Dec 2015 18:06:11 +0100 David Sterba wrote: > I don't know about all implications from changing the define to > sb->stripesize, also we want to define the allowed range etc. It would > be better to add more description to the patch. So, is the patch atleast somewhat usable and you jus

Re: [PATCH] BTRFS: Adds an option to select RAID Stripe size

2015-12-29 Thread Christoph Anton Mitterer
On Tue, 2015-12-29 at 16:44 +, Duncan wrote: > As I normally put it, btrfs is "definitely stabilizING, but not yet  > entirely stable and mature." [snip snap] And now... as a song please :D I'd also take a medieval rhyme ;-) Cheers, Chris. smime.p7s Description: S/MIME cryptographic signat

Re: Btrfs scrub failure for raid 6 kernel 4.3

2015-12-29 Thread Chris Murphy
Well all the generations on all devices are now the same, and so are the chunk trees. I haven't looked at them in detail to see if there are any discrepancies among them. If you don't care much for this file system, then you could try btrfs check --repair, using btrfs-progs 4.3.1 or integration br