RE: trim not working and irreparable errors from btrfsck

2015-08-14 Thread Paul Jones
-Original Message- From: linux-btrfs-ow...@vger.kernel.org [mailto:linux-btrfs- ow...@vger.kernel.org] On Behalf Of Marc Joliet Sent: Friday, 14 August 2015 6:06 PM To: linux-btrfs@vger.kernel.org Subject: Re: trim not working and irreparable errors from btrfsck Am Thu, 13 Aug

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

2015-08-14 Thread Eryu Guan
On Fri, Aug 14, 2015 at 06:47:02PM +0800, Anand Jain wrote: From: Anand Jain anand.j...@oracle.com Controlled EIO from the device is achieved using the dm device. Helper functions are at common/dmerror. Broadly steps will include calling _init_dmerror(). _init_dmerror() will use

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

2015-08-14 Thread Eryu Guan
On Fri, Aug 14, 2015 at 06:47:03PM +0800, Anand Jain wrote: From: Anand Jain anand.j...@oracle.com 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

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

2015-08-14 Thread Eryu Guan
On Fri, Aug 14, 2015 at 06:47:04PM +0800, Anand Jain wrote: From: Anand Jain anand.j...@oracle.com 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

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

2015-08-14 Thread Filipe David Manana
On Fri, Aug 14, 2015 at 11:47 AM, Anand Jain anand.j...@oracle.com wrote: From: Anand Jain anand.j...@oracle.com 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

Re: RAID0 wrong (raw) device?

2015-08-14 Thread Austin S Hemmelgarn
On 2015-08-13 19:29, Gareth Pye wrote: I would have been surprised if any generic file system copes well with being mounted in several locations at once, DRBD appears to fight really hard to avoid that happening :) And yeah I'm doing the second thing, I've successfully switched which of the

Re: RAID0 wrong (raw) device?

2015-08-14 Thread Ulli Horlacher
On Fri 2015-08-14 (00:24), Anand Jain wrote: root@toy02:~# btrfs filesystem show Label: data uuid: 411af13f-6cae-4f03-99dc-5941acb3135b Total devices 2 FS bytes used 106.51GiB devid3 size 1.82TiB used 82.03GiB path /dev/drbd2 devid4 size 1.82TiB used

re: Btrfs: don't start the log transaction if the log tree init fails

2015-08-14 Thread Dan Carpenter
Hello Miao Xie, The patch e87ac1368700: Btrfs: don't start the log transaction if the log tree init fails from Feb 20, 2014, leads to the following static checker warning: fs/btrfs/tree-log.c:178 start_log_trans() warn: we tested 'root-log_root' before and it was 'false'

Re: trim not working and irreparable errors from btrfsck

2015-08-14 Thread Marc Joliet
Am Fri, 14 Aug 2015 10:05:55 +0200 schrieb Marc Joliet mar...@gmx.de: (I mean, that's part of being a user of btrfs at this stage) I meant *being prepared* to file a bug report, not that one constantly has to file bug reports :) . -- Marc Joliet -- People who think they know everything really

Re: trim not working and irreparable errors from btrfsck

2015-08-14 Thread Marc Joliet
Am Thu, 13 Aug 2015 17:14:36 -0600 schrieb Chris Murphy li...@colorremedies.com: On Thu, Aug 13, 2015 at 3:23 AM, Marc Joliet mar...@gmx.de wrote: Speaking as a user, since fstrim -av still always outputs 0 bytes trimmed on my system: what's the status of this? Did anybody ever file a bug

Re: trim not working and irreparable errors from btrfsck

2015-08-14 Thread Jeff Mahoney
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 6/18/15 1:25 AM, Duncan wrote: Austin S Hemmelgarn posted on Wed, 17 Jun 2015 13:17:22 -0400 as excerpted: On 2015-06-17 11:40, Christian wrote: On 06/17/2015 11:28 AM, Chris Murphy wrote: However, fstrim still gives me 0 B (0 bytes)

Re: can we make balance delete missing devices?

2015-08-14 Thread Chris Murphy
On Fri, Aug 14, 2015 at 6:12 AM, Russell Coker russ...@coker.com.au wrote: [ 2918.502237] BTRFS info (device loop1): disk space caching is enabled [ 2918.503213] BTRFS: failed to read chunk tree on loop1 [ 2918.540082] BTRFS: open_ctree failed I just had a test RAID-1 filesystem with a

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

2015-08-14 Thread Anand Jain
From: Anand Jain anand.j...@oracle.com 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 anand.j...@oracle.com Reviewed-by: Filipe Manana fdman...@suse.com --- v5-v6:

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

2015-08-14 Thread Anand Jain
From: Anand Jain anand.j...@oracle.com Controlled EIO from the device is achieved using the dm device. Helper functions are at common/dmerror. Broadly steps will include calling _init_dmerror(). _init_dmerror() will use SCRATCH_DEV to create dm linear device and assign DMERROR_DEV to

The performance is not as expected when used several disks on raid0.

2015-08-14 Thread Eduardo Bach
Hi all, This is my first email to this list, so please excuse any gaffe. I am in the evaluation early stages of a new storage, an SGI MIS, currently with two HBAs LSI and 32 disks. The hba controllers are LSI 9207-8i and the disks are Seagate 6TB, model ST6000NM0004-1FT17Z. To evaluate the

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

2015-08-14 Thread Anand Jain
This is v6 of this patch set. Mainly accepts Filipe latest review comments and Eryu's review comments with thanks. Anand Jain (3): xfstests: btrfs: add functions to create dm-error device xfstests: btrfs: test device replace, with EIO on the src dev xfstests: btrfs: test device delete

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

2015-08-14 Thread Anand Jain
From: Anand Jain anand.j...@oracle.com 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:

Re: [PATCH v2] fstests: generic/018: expand write backwards sync but contiguous to test regression in btrfs

2015-08-14 Thread Eric Sandeen
On 8/13/15 3:47 AM, Liu Bo wrote: Btrfs has a problem when defraging a file which has a large fragment'ed range, it'd leave the tail extent as a seperate extent instead of merging it with previous extents. This makes generic/018 recognize the above regression. Sorry for the late review, but

Re: The performance is not as expected when used several disks on raid0.

2015-08-14 Thread Chris Murphy
On Fri, Aug 14, 2015 at 1:50 PM, Austin S Hemmelgarn ahferro...@gmail.com wrote: On 2015-08-14 14:31, Chris Murphy wrote: On Fri, Aug 14, 2015 at 9:16 AM, Eduardo Bach hellb...@gmail.com wrote: With btrfs the result approaches 3.5GB/s. When using mdadm+xfs the result reaches 6gb/s, which is

Re: The performance is not as expected when used several disks on raid0.

2015-08-14 Thread Austin S Hemmelgarn
On 2015-08-14 15:54, Chris Murphy wrote: On Fri, Aug 14, 2015 at 1:50 PM, Austin S Hemmelgarn ahferro...@gmail.com wrote: On 2015-08-14 14:31, Chris Murphy wrote: On Fri, Aug 14, 2015 at 9:16 AM, Eduardo Bach hellb...@gmail.com wrote: With btrfs the result approaches 3.5GB/s. When using

Re: Can't mount degraded. How to remove/add drives OFFLINE?

2015-08-14 Thread Timothy Normand Miller
I'm not sure my situation is quite like the one you linked, so here's my bug report: https://bugzilla.kernel.org/show_bug.cgi?id=102881 On Fri, Aug 14, 2015 at 2:44 PM, Chris Murphy li...@colorremedies.com wrote: On Fri, Aug 14, 2015 at 12:12 PM, Timothy Normand Miller theo...@gmail.com wrote:

Re: Can't mount degraded. How to remove/add drives OFFLINE?

2015-08-14 Thread Chris Murphy
On Fri, Aug 14, 2015 at 1:03 PM, Timothy Normand Miller theo...@gmail.com wrote: I'm not sure my situation is quite like the one you linked, so here's my bug report: https://bugzilla.kernel.org/show_bug.cgi?id=102881 I can easily reproduce with just 2 device RAID. I updated the bug. It's best

Re: Can't mount degraded. How to remove/add drives OFFLINE?

2015-08-14 Thread Chris Murphy
On Fri, Aug 14, 2015 at 12:12 PM, Timothy Normand Miller theo...@gmail.com wrote: Sorry about that empty email. I hit a wrong key, and gmail decided to send. Anyhow, my replacement drive is going to arrive this evening, and I need to know how to add it to my btrfs array. Here's the

Re: The performance is not as expected when used several disks on raid0.

2015-08-14 Thread Austin S Hemmelgarn
On 2015-08-14 14:31, Chris Murphy wrote: On Fri, Aug 14, 2015 at 9:16 AM, Eduardo Bach hellb...@gmail.com wrote: With btrfs the result approaches 3.5GB/s. When using mdadm+xfs the result reaches 6gb/s, which is the expected value when compared with parallel dd made on discs. mdadm with what

Can't mount degraded. How to remove/add drives OFFLINE?

2015-08-14 Thread Timothy Normand Miller
My -- Timothy Normand Miller, PhD Assistant Professor of Computer Science, Binghamton University http://www.cs.binghamton.edu/~millerti/ Open Graphics Project -- To unsubscribe from this list: send the line unsubscribe linux-btrfs in the body of a message to majord...@vger.kernel.org More

Re: The performance is not as expected when used several disks on raid0.

2015-08-14 Thread Calvin Walton
On Fri, 2015-08-14 at 12:16 -0300, Eduardo Bach wrote: Hi all, This is my first email to this list, so please excuse any gaffe. I am in the evaluation early stages of a new storage, an SGI MIS, currently with two HBAs LSI and 32 disks. The hba controllers are LSI 9207-8i and the disks are

Re: The performance is not as expected when used several disks on raid0.

2015-08-14 Thread Calvin Walton
On Fri, 2015-08-14 at 12:30 -0400, Calvin Walton wrote: On Fri, 2015-08-14 at 12:16 -0300, Eduardo Bach wrote: Hi all, This is my first email to this list, so please excuse any gaffe. I am in the evaluation early stages of a new storage, an SGI MIS, currently with two HBAs LSI and

Can't mount degraded. How to remove/add drives OFFLINE?

2015-08-14 Thread Timothy Normand Miller
Sorry about that empty email. I hit a wrong key, and gmail decided to send. Anyhow, my replacement drive is going to arrive this evening, and I need to know how to add it to my btrfs array. Here's the situation: - I had a drive fail, so I removed it and mounted degraded. - I hooked up a

Re: Can't mount degraded. How to remove/add drives OFFLINE?

2015-08-14 Thread Anand Jain
On 08/15/2015 02:12 AM, Timothy Normand Miller wrote: Sorry about that empty email. I hit a wrong key, and gmail decided to send. Anyhow, my replacement drive is going to arrive this evening, and I need to know how to add it to my btrfs array. Here's the situation: - I had a drive fail, so

Re: Can't mount degraded. How to remove/add drives OFFLINE?

2015-08-14 Thread Anand Jain
Just to be clear, I removed the drive (the original failed drive) when the power was off, then powered up, and then mounted degraded. That's not dangerous that I know of. patch has details. pls refer. Where is this patch, and what kernel versions can this be applied to?

Re: Deleted files cause btrfs-send to fail

2015-08-14 Thread Marc Joliet
Am Thu, 13 Aug 2015 10:54:58 +0200 schrieb Marc Joliet mar...@gmx.de: Am Thu, 13 Aug 2015 08:29:19 + (UTC) schrieb Duncan 1i5t5.dun...@cox.net: Marc Joliet posted on Thu, 13 Aug 2015 09:05:41 +0200 as excerpted: Here's the actual output now, obtained via btrfs-progs 4.0.1 from an

Re: Can't mount degraded. How to remove/add drives OFFLINE?

2015-08-14 Thread Timothy Normand Miller
On Fri, Aug 14, 2015 at 7:49 PM, Anand Jain anand.j...@oracle.com wrote: - I had a drive fail, so I removed it and mounted degraded. that bit dangerous to do without the below patch. patch has more details why. Just to be clear, I removed the drive (the original failed drive) when the

Re: RAID0 wrong (raw) device?

2015-08-14 Thread Anand Jain
First of all there is a known issue in handling multiple paths / instances of the same device image in btrfs. Fixing this caused regression earlier. And my survey [survey] BTRFS_IOC_DEVICES_READY return status almost told me not to fix the bug. But these are just a reporting issue which

Re: Major qgroup regression in 4.2?

2015-08-14 Thread Mark Fasheh
On Thu, Aug 13, 2015 at 04:13:08PM -0700, Mark Fasheh wrote: If there *is* a plan to make this all work again, can I please hear it? The comment mentions something about adding those nodes to a dirty_extent_root. Why wasn't that done? Ok so I had more time to look through the changes today and

[survey] sysfs layout for btrfs

2015-08-14 Thread Anand Jain
Hello, as of now btrfs sysfs does not include the attributes for the volume manager part in its sysfs layout, so its being developed and there are two types of layout here below, so I have a quick survey to know which will be preferred. contenders are: 1. FS and VM (volume manager)

Re: Can't mount degraded. How to remove/add drives OFFLINE?

2015-08-14 Thread Timothy Normand Miller
I applied that patch to my 4.1.4, it mounted degraded, and now it's balancing to the new drive. Thanks for all the help! On Fri, Aug 14, 2015 at 8:28 PM, Anand Jain anand.j...@oracle.com wrote: Just to be clear, I removed the drive (the original failed drive) when the power was off, then

Re: Deleted files cause btrfs-send to fail

2015-08-14 Thread Duncan
Marc Joliet posted on Fri, 14 Aug 2015 23:37:37 +0200 as excerpted: (One other thing I found interesting was that btrfs scrub didn't care about the link count errors.) A lot of people are confused about exactly what btrfs scrub does, and expect it to detect and possibly fix stuff it has

lockup

2015-08-14 Thread Russell Coker
I have a Xen server with 14 DomUs that are being used for BTRFS and ZFS training. About 5 people are corrupting virtual disks and scrubbing them, lots of IO. All the virtual machine disk images are snapshots of a master image with copy on write. I just had the following error which ended

Re: delete missing with two missing devices doesn't delete both missing, only does a partial reconstruction

2015-08-14 Thread Timothy Normand Miller
BTW, when this is all over with, how do I make sure there are really two copies of everything? Will a scrub verify this? Should I run a balance operation? On Fri, Aug 14, 2015 at 11:29 PM, Timothy Normand Miller theo...@gmail.com wrote: After applying Anand's patch, I was able to mount my

Re: Can't mount degraded. How to remove/add drives OFFLINE?

2015-08-14 Thread Chris Murphy
I thought for a second that maybe the problem is due to the phantom single chunk(s) created at mkfs time. I redid the test, and did a balance to get rid of the single chunk. I did this right after populating volume with some data. But the problem still happens. --- Chris Murphy -- To unsubscribe

Re: delete missing with two missing devices doesn't delete both missing, only does a partial reconstruction

2015-08-14 Thread Anand Jain
BTW, when this is all over with, how do I make sure there are really two copies of everything? Will a scrub verify this? Should I run a balance operation? pls use 'btrfs bal profile and convert' to migrate single chunk (if any created when there were lesser number of RW-able devices) back

delete missing with two missing devices doesn't delete both missing, only does a partial reconstruction

2015-08-14 Thread Timothy Normand Miller
After applying Anand's patch, I was able to mount my 4-drive RAID1 and bring a new fourth drive online. However, something weird happened where the first delete missing only deleted one missing drive and only did a partial duplication. I've posted a bug report here:

[PATCH 05/23] Btrfs: rename super_kobj to fsid_kobj

2015-08-14 Thread Anand Jain
Signed-off-by: Anand Jain anand.j...@oracle.com --- fs/btrfs/sysfs.c | 36 ++-- fs/btrfs/volumes.c | 2 +- fs/btrfs/volumes.h | 2 +- 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/fs/btrfs/sysfs.c b/fs/btrfs/sysfs.c index 52319d1..e0ac859

[PATCH 02/23] Btrfs: rename btrfs_sysfs_remove_one to btrfs_sysfs_remove_mounted

2015-08-14 Thread Anand Jain
--- fs/btrfs/ctree.h | 2 +- fs/btrfs/disk-io.c | 4 ++-- fs/btrfs/sysfs.c | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h index afce306..4484063 100644 --- a/fs/btrfs/ctree.h +++ b/fs/btrfs/ctree.h @@ -4005,7 +4005,7 @@ int

[PATCH 17/23] Btrfs: kernel operation should come after user input has been verified

2015-08-14 Thread Anand Jain
By general rule of thumb there shouldn't be any way that user land could trigger a kernel operation just by sending wrong arguments. Here do commit cleanups after user input has been verified. Signed-off-by: Anand Jain anand.j...@oracle.com --- fs/btrfs/dev-replace.c | 26

[PATCH 21/23] Btrfs: fix fs logging for multi device

2015-08-14 Thread Anand Jain
In case of multi device btrfs fs, using one of device for the logging purpose it quite confusing, instead use the fsid. FSID is bit long, but the device path can be long as well in some cases. Signed-off-by: Anand Jain anand.j...@oracle.com --- fs/btrfs/super.c | 4 ++-- 1 file changed, 2

[PATCH 12/23] Btrfs: use btrfs_find_device_by_user_input()

2015-08-14 Thread Anand Jain
btrfs_rm_device() has a section of the code which can be replaced btrfs_find_device_by_user_input() Signed-off-by: Anand Jain anand.j...@oracle.com --- fs/btrfs/volumes.c | 84 -- 1 file changed, 19 insertions(+), 65 deletions(-) diff --git

[PATCH 10/23] Btrfs: rename btrfs_dev_replace_find_srcdev()

2015-08-14 Thread Anand Jain
The patch renames btrfs_dev_replace_find_srcdev() to btrfs_find_device_by_user_input() so that it can be used by btrfs_rm_device() as well in the next patches. Signed-off-by: Anand Jain anand.j...@oracle.com --- fs/btrfs/dev-replace.c | 24 +--- fs/btrfs/volumes.c | 19

[PATCH 00/23] btrfs device related patch set

2015-08-14 Thread Anand Jain
This patch set includes patches which has been sent before independently, however here they are consolidated on the current integration 4.3. Most of them are cleanup and preparatory work for the RFE which are published before, viz.. addition of sys volume attributes and introduce a method to

[PATCH 01/23] Btrfs: rename btrfs_sysfs_add_one to btrfs_sysfs_add_mounted

2015-08-14 Thread Anand Jain
Signed-off-by: Anand Jain anand.j...@oracle.com --- fs/btrfs/ctree.h | 2 +- fs/btrfs/disk-io.c | 2 +- fs/btrfs/sysfs.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h index 938efe3..afce306 100644 --- a/fs/btrfs/ctree.h +++

[PATCH 08/23] Btrfs: device delete by devid

2015-08-14 Thread Anand Jain
This introduces BTRFS_IOC_RM_DEV_V2, which can accept devid as an argument to delete the device. Current only choice to is to pass device path for the device delete cli, but if btrfs is unable to read device SB, then cli fails. And user won't be able to delete the device. With this patch now the

[PATCH 22/23] Btrfs: move kobj stuff out of dev_replace lock range

2015-08-14 Thread Anand Jain
From: Liu Bo bo.li@oracle.com To avoid deadlock described in commit 084b6e7c7607 (btrfs: Fix a lockdep warning when running xfstest.), we should move kobj stuff out of dev_replace lock range. Signed-off-by: Liu Bo bo.li@oracle.com Signed-off-by: Anand Jain anand.j...@oracle.com ---

[PATCH 09/23] Btrfs: move check for min number of devices to a function

2015-08-14 Thread Anand Jain
btrfs_rm_device() has a section of the code to check for min number of the devices required by various group profile. This patch move that part of the code in the function __check_raid_min_devices() Signed-off-by: Anand Jain anand.j...@oracle.com --- fs/btrfs/volumes.c | 78

[PATCH 23/23] Btrfs: allow -o rw,degraded for single group profile

2015-08-14 Thread Anand Jain
As of now only the exception to allow mount when number of missing device is more than group profile tolerance count is RDONLY this patch adds another lateral exception DEGRADED This will enable user to recover from the following and similar volume unavailability issue raid1 volume:

[PATCH 15/23] Btrfs: use btrfs_scratch_superblock() in btrfs_rm_device()

2015-08-14 Thread Anand Jain
With the previous patches now the btrfs_scratch_superblock() is ready to be used in btrfs_rm_device() so use it. Signed-off-by: Anand Jain anand.j...@oracle.com --- fs/btrfs/volumes.c | 69 -- 1 file changed, 5 insertions(+), 64 deletions(-)

[PATCH 0/2] Btrfs-progs: device delete to accept devid

2015-08-14 Thread Anand Jain
This is btrfs-progs side of the patch. Kernel patch is Btrfs: device delete by devid Anand Jain (2): btrfs-progs: move is_numerical to utils-lib.h and make it non static btrfs-progs: device delete to accept devid Documentation/btrfs-device.asciidoc | 2 +- cmds-device.c

[PATCH 1/2] btrfs-progs: move is_numerical to utils-lib.h and make it non static

2015-08-14 Thread Anand Jain
Signed-off-by: Anand Jain anand.j...@oracle.com --- cmds-replace.c | 11 --- utils-lib.c| 11 +++ utils.h| 1 + 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/cmds-replace.c b/cmds-replace.c index 85365e3..e6a27e3 100644 --- a/cmds-replace.c +++

[PATCH 2/2] btrfs-progs: device delete to accept devid

2015-08-14 Thread Anand Jain
This patch introduces new option devid for the command btrfs device delete device_path|devid[..] mnt In a user reported issue on a 3-disk-RAID1, one disk failed with its SB unreadable. Now with this patch user will have a choice to delete the device using devid. The other method we could do,

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

2015-08-14 Thread Anand Jain
From: Anand Jain anand.j...@oracle.com 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:

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

2015-08-14 Thread Anand Jain
From: Anand Jain anand.j...@oracle.com Controlled EIO from the device is achieved using the dm device. Helper functions are at common/dmerror. Broadly steps will include calling _init_dmerror(). _init_dmerror() will use SCRATCH_DEV to create dm linear device and assign DMERROR_DEV to

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

2015-08-14 Thread Anand Jain
This is v5 of this patch set. Mainly accepts Filipe latest review comments. Anand Jain (3): xfstests: btrfs: add functions to create dm-error device xfstests: btrfs: test device replace, with EIO on the src dev xfstests: btrfs: test device delete with EIO on src dev common/dmerror |

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

2015-08-14 Thread Anand Jain
From: Anand Jain anand.j...@oracle.com 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 anand.j...@oracle.com Reviewed-by: Filipe Manana fdman...@suse.com --- v4-v5:

can we make balance delete missing devices?

2015-08-14 Thread Russell Coker
[ 2918.502237] BTRFS info (device loop1): disk space caching is enabled [ 2918.503213] BTRFS: failed to read chunk tree on loop1 [ 2918.540082] BTRFS: open_ctree failed I just had a test RAID-1 filesystem with a missing device. I mounted it with the degraded option and added a new device. I

[PATCH 07/23] Btrfs: __btrfs_std_error() logic should be consistent w/out CONFIG_PRINTK defined

2015-08-14 Thread Anand Jain
error handling logic behaves differently with or without CONFIG_PRINTK defined, since there are two copies of the same function which a bit of different logic One, when CONFIG_PRINTK is defined, code is __btrfs_std_error(..) { :: save_error_info(fs_info); if (sb-s_flags MS_BORN)

[PATCH 13/23] Btrfs: add btrfs_read_dev_one_super() to read one specific SB

2015-08-14 Thread Anand Jain
This uses a chunk of code from btrfs_read_dev_super() and creates a function called btrfs_read_dev_one_super() so that next patch can use it for scratch superblock. Signed-off-by: Anand Jain anand.j...@oracle.com --- fs/btrfs/disk-io.c | 54 ++

[PATCH 06/23] Btrfs: SB read failure should return EIO for __bread failure

2015-08-14 Thread Anand Jain
This will return EIO when __bread() fails to read SB, instead of EINVAL. Signed-off-by: Anand Jain anand.j...@oracle.com --- fs/btrfs/disk-io.c | 18 +++--- fs/btrfs/volumes.c | 8 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/fs/btrfs/disk-io.c

[PATCH 03/23] Btrfs: rename btrfs_kobj_add_device to btrfs_sysfs_add_device_link

2015-08-14 Thread Anand Jain
--- fs/btrfs/dev-replace.c | 2 +- fs/btrfs/sysfs.c | 4 ++-- fs/btrfs/sysfs.h | 2 +- fs/btrfs/volumes.c | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/fs/btrfs/dev-replace.c b/fs/btrfs/dev-replace.c index 564a7de..c1bf0d6 100644 ---

[PATCH 11/23] Btrfs: use BTRFS_ERROR_DEV_MISSING_NOT_FOUND when missing device is not found

2015-08-14 Thread Anand Jain
use btrfs specific error code BTRFS_ERROR_DEV_MISSING_NOT_FOUND instead of -ENOENT. Next this removes the logging when user specifies missing and we don't find it in the kernel device list. logging are for system events not for user input errors. Signed-off-by: Anand Jain anand.j...@oracle.com

[PATCH 16/23] Btrfs: device path change must be logged

2015-08-14 Thread Anand Jain
From the issue diagnosable point of view, log if the device path is changed. Signed-off-by: Anand Jain anand.j...@oracle.com --- fs/btrfs/volumes.c | 4 1 file changed, 4 insertions(+) diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index ebf37a9..dcb10fa 100644 ---

[PATCH 20/23] Btrfs: move device close to btrfs_close_one_device

2015-08-14 Thread Anand Jain
this will help to add the proposed device offline RFE --- fs/btrfs/volumes.c | 66 +- fs/btrfs/volumes.h | 1 + 2 files changed, 37 insertions(+), 30 deletions(-) diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index f3ca87d..00ca858

[PATCH 04/23] Btrfs: rename btrfs_kobj_rm_device to btrfs_sysfs_rm_device_link

2015-08-14 Thread Anand Jain
--- fs/btrfs/dev-replace.c | 2 +- fs/btrfs/sysfs.c | 6 +++--- fs/btrfs/sysfs.h | 2 +- fs/btrfs/volumes.c | 6 +++--- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/fs/btrfs/dev-replace.c b/fs/btrfs/dev-replace.c index c1bf0d6..6eb9324 100644 ---

[PATCH 18/23] Btrfs: check device_path in btrfs_find_device_by_user_input()

2015-08-14 Thread Anand Jain
so btrfs_dev_replace_start() can be sleak and btrfs_rm_device() will also need it. Signed-off-by: Anand Jain anand.j...@oracle.com --- fs/btrfs/dev-replace.c | 4 fs/btrfs/volumes.c | 3 +++ 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/fs/btrfs/dev-replace.c

[PATCH 14/23] Btrfs: fix btrfs_scratch_superblock() with fixes from device delete

2015-08-14 Thread Anand Jain
This patch updates the btrfs_scratch_superblock(), (which is used by the replace device thread), with those fixes from the scratch superblock code section of btrfs_rm_device(). The fixes are: Scratch all copies of superblock Notify kobject that superblock has been changed Update time on the

[PATCH 19/23] Btrfs: avoid user cli usage error logging into the sys log

2015-08-14 Thread Anand Jain
Signed-off-by: Anand Jain anand.j...@oracle.com --- fs/btrfs/volumes.c | 1 - 1 file changed, 1 deletion(-) diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index 5803c45..f3ca87d 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c @@ -198,7 +198,6 @@ btrfs_get_bdev_and_sb(const char