[PATCH v9 1/3] xfstests: btrfs: add functions to create dm-error device

2015-09-03 Thread Anand Jain
From: Anand Jain Controlled EIO from the device is achieved using the dm device. Helper functions are at common/dmerror. Broadly steps will include calling _dmerror_init(). _dmerror_init() will use SCRATCH_DEV to create dm linear device and assign DMERROR_DEV to /dev/mapper/error-test. When tes

[PATCH v9 3/3] xfstests: btrfs: test device delete with EIO on src dev

2015-09-03 Thread Anand Jain
From: Anand Jain This test case tests if the device delete works with the failed (EIO) source device. EIO errors are achieved usign the DM device. This test would need following btrfs-progs and btrfs kernel patch btrfs-progs: device delete to accept devid Btrfs: device delete by devid How

[PATCH v9 0/3] dm error based test cases

2015-09-03 Thread Anand Jain
The patch 1/3 provides a framework to use dmerror device to test volume manager operations. Patch 2/3 adds a test case to test replacing a dmerror device Patch 3/3 adds a test case to test deleting a dmerror device This is v9 of this patch set. In this version it mainly accepts Eryu's review comme

[PATCH v9 2/3] xfstests: btrfs: test device replace, with EIO on the src dev

2015-09-03 Thread Anand Jain
From: Anand Jain This test case will test to confirm the replace works with the failed (EIO) replacing source device. EIO condition is achieved using the DM device. Signed-off-by: Anand Jain Reviewed-by: Filipe Manana --- v8->v9: no change. v9 since 1/3 is revised v7->v8: . Inline with the

Re: [PATCH v8 1/3] xfstests: btrfs: add functions to create dm-error device

2015-09-03 Thread Anand Jain
Hi Eryu, Thanks for commenting. sorry for the delay other stuff took precedence for a while. more below.. On 08/31/2015 02:15 PM, Eryu Guan wrote: On Tue, Aug 25, 2015 at 12:39:26PM +0800, Anand Jain wrote: From: Anand Jain Controlled EIO from the device is achieved using the dm device. H

Re: [PATCH v2 8/9] Btrfs: wire up the free space tree to the extent tree

2015-09-03 Thread Omar Sandoval
On Thu, Sep 03, 2015 at 12:44:26PM -0700, Omar Sandoval wrote: > The free space tree is updated in tandem with the extent tree. There are > only a handful of places where we need to hook in: > > 1. Block group creation > 2. Block group deletion > 3. Delayed refs (extent creation and deletion) > 4.

Re: [PATCH v2 0/9] free space B-tree

2015-09-03 Thread Omar Sandoval
On Fri, Sep 04, 2015 at 09:29:45AM +0800, Zhao Lei wrote: > Hi, Omar Sandoval > > [PATCH 7/9] have following compiler warning: > fs/btrfs/tests/free-space-tree-tests.c: In function > '__check_free_space_extents': > fs/btrfs/tests/free-space-tree-tests.c:45: warning: 'offset' may be used > u

Re: [PATCH] btrfs: scrub: set error stats when tree block spanning stripes

2015-09-03 Thread Qu Wenruo
Hi, David and Zhao, David Sterba wrote on 2015/09/03 15:17 +0200: On Thu, Aug 27, 2015 at 09:44:05AM +0800, Zhao Lei wrote: [...] Thanks for the links and summary! But it is still uncorrectable because neither kernel nor btrfsck can fix it(only can report). I'm curious if it' is possible to

RE: [PATCH v2 0/9] free space B-tree

2015-09-03 Thread Zhao Lei
Hi, Omar Sandoval [PATCH 7/9] have following compiler warning: fs/btrfs/tests/free-space-tree-tests.c: In function '__check_free_space_extents': fs/btrfs/tests/free-space-tree-tests.c:45: warning: 'offset' may be used uninitialized in this function It is just a compiler warning, and wil

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

2015-09-03 Thread 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 this happens in the critical section, things are especially bad because we block new transactio

[PATCH v2 4/9] Btrfs: refactor caching_thread()

2015-09-03 Thread Omar Sandoval
We're also going to load the free space tree from caching_thread(), so we should refactor some of the common code. Signed-off-by: Omar Sandoval --- fs/btrfs/ctree.h | 3 +++ fs/btrfs/extent-tree.c | 59 -- 2 files changed, 36 insertions(+),

[PATCH v2 2/9] Btrfs: add extent buffer bitmap sanity tests

2015-09-03 Thread Omar Sandoval
Sanity test the extent buffer bitmap operations (test, set, and clear) against the equivalent standard kernel operations. Signed-off-by: Omar Sandoval --- fs/btrfs/extent_io.c | 34 ++ fs/btrfs/extent_io.h | 4 +- fs/btrfs/tests/extent-io-tests.c | 138

[PATCH v2 7/9] Btrfs: add free space tree sanity tests

2015-09-03 Thread Omar Sandoval
This tests the operations on the free space tree trying to excercise all of the main cases for both formats. Between this and xfstests, the free space tree should have pretty good coverage. Signed-off-by: Omar Sandoval --- fs/btrfs/Makefile | 3 +- fs/btrfs/super.c

[PATCH v2 9/9] Btrfs: add free space tree mount option

2015-09-03 Thread Omar Sandoval
Now we can finally hook up everything so we can actually use free space tree. On the first mount with the free_space_tree mount option, the free space tree will be created and the FREE_SPACE_TREE read-only compat bit will be set. Any time the filesystem is mounted from then on, we will use the free

[PATCH v2 1/9] Btrfs: add extent buffer bitmap operations

2015-09-03 Thread Omar Sandoval
These are going to be used for the free space tree bitmap items. Signed-off-by: Omar Sandoval --- fs/btrfs/extent_io.c | 149 +++ fs/btrfs/extent_io.h | 6 +++ 2 files changed, 155 insertions(+) diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/exten

[PATCH v2 5/9] Btrfs: introduce the free space B-tree on-disk format

2015-09-03 Thread Omar Sandoval
The on-disk format for the free space tree is straightforward. Each block group is represented in the free space tree by a free space info item that stores accounting information: whether the free space for this block group is stored as bitmaps or extents and how many extents of free space exist fo

[PATCH v2 3/9] Btrfs: add helpers for read-only compat bits

2015-09-03 Thread Omar Sandoval
We're finally going to add one of these for the free space tree, so let's add the same nice helpers that we have for the incompat bits. Reviewed-by: Josef Bacik Signed-off-by: Omar Sandoval --- fs/btrfs/ctree.h | 34 ++ 1 file changed, 34 insertions(+) diff --gi

[PATCH v2 0/9] free space B-tree

2015-09-03 Thread Omar Sandoval
Here's version 2 of the the free space B-tree patches, addressing Josef's review from the last round, which you can find here: http://www.spinics.net/lists/linux-btrfs/msg46713.html Changes from v1->v2: - Cleaned up a bunch of unnecessary instances of "if (ret) goto out; ret = 0" - Added aborts i

[PATCH v2 8/9] Btrfs: wire up the free space tree to the extent tree

2015-09-03 Thread Omar Sandoval
The free space tree is updated in tandem with the extent tree. There are only a handful of places where we need to hook in: 1. Block group creation 2. Block group deletion 3. Delayed refs (extent creation and deletion) 4. Block group caching Signed-off-by: Omar Sandoval --- fs/btrfs/extent-tree

Re: Btrfs progs release 4.2

2015-09-03 Thread Suman Chakravartula
Thank you! I see a lot of really useful changes. I've just updated Rockstor testing repo to use 4.2. On Thu, Sep 3, 2015 at 5:39 AM, David Sterba wrote: > Hi, > > here goes anoher release. There are many cleanups/bugfixes and just a handful > of user-visible improvements. > > Thanks to all contri

Re: [PATCH] btrfs: scrub: set error stats when tree block spanning stripes

2015-09-03 Thread David Sterba
On Thu, Aug 27, 2015 at 09:44:05AM +0800, Zhao Lei wrote: [...] Thanks for the links and summary! > But it is still uncorrectable because neither kernel nor btrfsck can fix > it(only can report). I'm curious if it' is possible to write code that would fix the problem, eg. te relocate or shift th

Btrfs progs release 4.2

2015-09-03 Thread David Sterba
Hi, here goes anoher release. There are many cleanups/bugfixes and just a handful of user-visible improvements. Thanks to all contributors! enhancements: * mkfs: do not create extra single chunks on multiple devices * resize: try to guess the minimal size, 'inspect min-dev-size' * qgroup a