[PATCH] btrfs: cleanup assigning next active device with a check

2016-04-18 Thread Anand Jain
Creates helper function as needed by the device delete and replace operations. Also now it checks if the next device being assigned is an active device. Signed-off-by: Anand Jain Reported-by: Yauhen Kharuzhy --- fs/btrfs/dev-replace.c | 8 +++- fs/btrfs/volumes.c | 51

[PATCH] btrfs: cleanup assigning next active device with a check

2016-04-18 Thread Anand Jain
Creates helper fucntion as needed by the device delete and replace operations. Also now it checks if the next device being assigned is an active device. Signed-off-by: Anand Jain --- fs/btrfs/dev-replace.c | 8 +++- fs/btrfs/volumes.c | 51

[PATCH 04/13] btrfs: Allow barrier_all_devices to do per-chunk device check

2016-04-18 Thread Anand Jain
From: Qu Wenruo The last user of num_tolerated_disk_barrier_failures is barrier_all_devices(). But it's can be easily changed to new per-chunk degradable check framework. Now btrfs_device will have two extra members, representing send/wait error, set at write_dev_flush() time. And then check it

[PATCH 01/13] btrfs: Introduce a new function to check if all chunks a OK for degraded mount

2016-04-18 Thread Anand Jain
From: Qu Wenruo Introduce a new function, btrfs_check_degradable(), to judge if all chunks in btrfs is OK for degraded mount. It provides the new basis for accurate btrfs mount/remount and even runtime degraded mount check other than old one-size-fit-all method. Signed-off-by: Qu Wenruo --- f

[PATCH v5 00/13] Introduce device state 'failed', spare device and auto replace

2016-04-18 Thread Anand Jain
effort to make the changes as in a above. Progs: a. Added to call btrfs_register_one_device() when doing btrfs spare add Anand Jain (8): btrfs: introduce BTRFS_FEATURE_INCOMPAT_SPARE_DEV btrfs: add check not to mount a spare device btrfs: support btrfs dev scan for spare device btrfs

[PATCH 02/13] btrfs: Do per-chunk check for mount time check

2016-04-18 Thread Anand Jain
7;s not OK to mount it as degraded. Reported-by: Zhao Lei Reported-by: Anand Jain Signed-off-by: Qu Wenruo [Btrfs: use btrfs_error instead of btrfs_err during mount] Signed-off-by: Anand Jain --- fs/btrfs/disk-io.c | 18 ++ 1 file changed, 10 insertions(+), 8 deletions(-) di

[PATCH 05/13] btrfs: Cleanup num_tolerated_disk_barrier_failures

2016-04-18 Thread Anand Jain
From: Qu Wenruo As we use per-chunk degradable check, now the global num_tolerated_disk_barrier_failures is of no use. So cleanup it. Signed-off-by: Qu Wenruo [Btrfs: resolve conflict to apply 'btrfs: Cleanup num_tolerated_disk_barrier_failures'] Signed-off-by: Anand Jain ---

[PATCH 08/13] btrfs: support btrfs dev scan for spare device

2016-04-18 Thread Anand Jain
From: Anand Jain When the user or system calls the BTRFS_IOC_SCAN_DEV, ioctl this patch will make sure it is added to the device list and set it as spare. This operation will be same when BTRFS_IOC_DEVICES_READY as well since BTRFS_IOC_DEVICES_READY ioctl has been doing that by legacy. Signed

[PATCH 09/13] btrfs: provide framework to get and put a spare device

2016-04-18 Thread Anand Jain
From: Anand Jain This adds functions to get and put a spare device from the list. So that hot repace code can pick a spare device when needed. Signed-off-by: Anand Jain Tested-by: Austin S. Hemmelgarn --- fs/btrfs/ctree.h | 1 + fs/btrfs/super.c | 5 + fs/btrfs/volumes.c | 53

[PATCH 06/13] btrfs: introduce BTRFS_FEATURE_INCOMPAT_SPARE_DEV

2016-04-18 Thread Anand Jain
From: Anand Jain Add BTRFS_FEATURE_INCOMPAT_SPARE_DEV (400) flag to identify a spare device. Along with this it checks in the mount context that a spare device will fail to mount. As spare devices aren't mountable. Signed-off-by: Anand Jain Tested-by: Austin S. Hemmelgarn --- fs/

[PATCH 10/13] btrfs: introduce helper functions to perform hot replace

2016-04-18 Thread Anand Jain
From: Anand Jain Hot replace / auto replace is important volume manager feature and is critical to the data center operations, so that the degraded volume can be brought back to a healthy state at the earliest and without manual intervention. This modifies the existing replace code to suite the

[PATCH 07/13] btrfs: add check not to mount a spare device

2016-04-18 Thread Anand Jain
From: Anand Jain Spare devices can be scanned but shouldn't be mountable. Signed-off-by: Anand Jain Tested-by: Austin S. Hemmelgarn --- fs/btrfs/disk-io.c | 8 1 file changed, 8 insertions(+) diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 65c9f19d8017..e9fca3b

[PATCH 13/13] btrfs: check for failed device and hot replace

2016-04-18 Thread Anand Jain
From: Anand Jain This patch checks for failed device and kicks out auto replace, if when user decided to disable auto replace it can be done by future sysfs or future ioctl interface to set fs_info->no_auto_replace parameter to 1. Signed-off-by: Anand Jain Tested-by: Austin S. Hemmelg

[PATCH 03/13] btrfs: Do per-chunk degraded check for remount

2016-04-18 Thread Anand Jain
From: Qu Wenruo Just the same for mount time check, use new btrfs_check_degraded() to do per chunk check. Signed-off-by: Qu Wenruo Btrfs: use btrfs_error instead of btrfs_err during remount Signed-off-by: Anand Jain --- fs/btrfs/super.c | 11 +++ 1 file changed, 7 insertions(+), 4

[PATCH 11/13] btrfs: introduce device dynamic state transition to offline or failed

2016-04-18 Thread Anand Jain
From: Anand Jain This patch provides helper functions to force a device to offline or failed, and we need this device states for the following reasons, 1) a. it can be reported that device has failed when it does b. close the device when it goes offline so that blocklayer can cleanup 2

[PATCH 12/13] btrfs: check device for critical errors and mark failed

2016-04-18 Thread Anand Jain
From: Anand Jain Write and Flush errors are considered as critical errors, upon which the device will be brought offline and marked as failed. Write and Flush errors are identified using device error statistics. This is monitored using a kthread btrfs_health. Signed-off-by: Anand Jain Tested

Re: RAID5 Unable to remove Failing HD

2016-04-19 Thread Anand Jain
# btrfs device delete 3 /mnt/store/ ERROR: device delete by id failed: Inappropriate ioctl for device Were the patch sets above for btrfs-progs or for the kernel ? Looks like you're primarily interested in the concern2 patches, device delete by devid. A quick search of the list back-history

Re: Question: raid1 behaviour on failure

2016-04-20 Thread Anand Jain
1. mount the raid1 (2 disc with different size) 2. unplug the biggest drive (hotplug) Btrfs won't know that you have plugged-out a disk. Though it experiences IO failures, it won't close the bdev. 3. try to copy something to the degraded raid1 This will work as long as you do _no

Re: Question: raid1 behaviour on failure

2016-04-21 Thread Anand Jain
On 04/21/2016 01:15 PM, Matthias Bodenbinder wrote: Am 20.04.2016 um 15:32 schrieb Anand Jain: 1. mount the raid1 (2 disc with different size) 2. unplug the biggest drive (hotplug) Btrfs won't know that you have plugged-out a disk. Though it experiences IO failures, it won&#x

[PATCH 0/3 v3] flags to access backup SB

2013-03-13 Thread Anand Jain
ult v1->v2: Accepts Eric and Zach review. Separates fix into 3 patches for easy logical understanding Anand Jain (3): btrfs-progs: Introduce flag BTRFS_SCAN_REGISTER to replace run_ioctl btrfs-progs: Introduce flag BTRFS_SCAN_BACKUP_SB for btrfs_read_dev_super btrfs

[PATCH 1/3 v3] btrfs-progs: Introduce flag BTRFS_SCAN_REGISTER to replace run_ioctl

2013-03-13 Thread Anand Jain
Introduce flag BTRFS_SCAN_REGISTER to replace the parameter run_ioctl which controls calling the function btrfs_register_one_device(). Signed-off-by: Anand Jain --- btrfsctl.c| 2 +- cmds-device.c | 4 ++-- disk-io.c | 3 ++- find-root.c | 3 ++- utils.c | 17

[PATCH 2/3 v3] btrfs-progs: Introduce flag BTRFS_SCAN_BACKUP_SB for btrfs_read_dev_super

2013-03-13 Thread Anand Jain
backup SB when primary SB fails. This patch just provides the frame-work, keeping all the logic in the code same with or without this patch. Signed-off-by: Anand Jain --- disk-io.c | 10 +++--- disk-io.h | 3 ++- find-root.c | 3 ++- utils.h | 1 + volumes.c | 4 +++- 5 files

[PATCH 3/3 v3] btrfs-progs: disable using backup superblock by default

2013-03-13 Thread Anand Jain
Signed-off-by: Anand Jain --- disk-io.c | 2 +- find-root.c | 2 +- volumes.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/disk-io.c b/disk-io.c index 796394f..030f080 100644 --- a/disk-io.c +++ b/disk-io.c @@ -880,7 +880,7 @@ static struct btrfs_fs_info

Re: [PATCH 3/3] btrfs-progs: use BTRFS_SCAN_BACKUP_SB flag in btrfs_scan_one_device

2013-03-13 Thread Anand Jain
Thanks Eric and David. I have sent out V3 patch-set which will disable access to backup super-block unless requested by the user. here below are some test cases and results before and after this fix.. which finds the patch works awesome. the original problem which all this start

[PATCH] btrfs-progs: update .gitignore file

2013-03-13 Thread Anand Jain
Signed-off-by: Anand Jain --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index a32b96c..3c9eba9 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ *.static.o .*.o.d version.h +version man/*.gz btrfs btrfs.static -- 1.8.1.227.g44fe835

[PATCH 0/3 v4] flags to access backup SB

2013-03-13 Thread Anand Jain
a new patch [PATCH 3/3] btrfs-progs: disable using backup superblock by default v1->v2: Accepts Eric and Zach review. Separates fix into 3 patches for easy logical understanding Anand Jain (3): btrfs-progs: Introduce flag BTRFS_SCAN_REGISTER to replace

[PATCH 1/3 v4] btrfs-progs: Introduce flag BTRFS_SCAN_REGISTER to replace run_ioctl

2013-03-13 Thread Anand Jain
Introduce flag BTRFS_SCAN_REGISTER to replace the parameter run_ioctl which controls calling the function btrfs_register_one_device(). Signed-off-by: Anand Jain --- btrfsctl.c| 2 +- cmds-device.c | 4 ++-- disk-io.c | 3 ++- find-root.c | 3 ++- utils.c | 17

[PATCH 3/3 v4] btrfs-progs: disable using backup superblock by default

2013-03-13 Thread Anand Jain
Signed-off-by: Anand Jain --- disk-io.c | 2 +- find-root.c | 2 +- volumes.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/disk-io.c b/disk-io.c index 796394f..c2e1c8a 100644 --- a/disk-io.c +++ b/disk-io.c @@ -880,7 +880,7 @@ static struct btrfs_fs_info

[PATCH 2/3 v4] btrfs-progs: Introduce flag BTRFS_SCAN_BACKUP_SB for btrfs_read_dev_super

2013-03-13 Thread Anand Jain
backup SB when primary SB fails. This patch just provides the frame-work, keeping all the logic in the code same with or without this patch. Signed-off-by: Anand Jain --- disk-io.c | 10 +++--- disk-io.h | 3 ++- find-root.c | 3 ++- utils.h | 1 + volumes.c | 4 +++- 5 files

[PATCH] btrfs-progs: print errno string when /dev/btrfs-control open fails

2013-03-13 Thread Anand Jain
Of recently and intermittently I am seeing open fail for /dev/btrfs-control (btrfs is loaded), and there are no dmesg errors, this may not be a complete help in digging this issue but something which is necessary. Thanks Signed-off-by: Anand Jain --- utils.c | 3 ++- 1 file changed, 2

btrfs_scan_one_device return error code

2013-03-14 Thread Anand Jain
Hi, /dev/sdc does not contain btrfs SB at all.. --- # btrfs dev scan /dev/sdc Scanning for Btrfs filesystems in '/dev/sdc' ERROR: unable to scan the device '/dev/sdc' - Invalid argument --- here appropriate error is something like no btrfs found on dev However btrfs_scan_one_device (ke

Re: [PATCH 3/3] btrfs-progs: use BTRFS_SCAN_BACKUP_SB flag in btrfs_scan_one_device

2013-03-14 Thread Anand Jain
y - Thanks, Anand On 03/13/2013 07:46 PM, Anand Jain wrote: Thanks Eric and David. I have sent out V3 patch-set which will disable access to backup super-block unless requested by the user. here below are some test cases and results before and after this fix.. which finds the patch

Re: [PATCH 3/3 v4] btrfs-progs: disable using backup superblock by default

2013-03-14 Thread Anand Jain
On 03/14/2013 12:36 PM, Eric Sandeen wrote: On 3/13/13 10:05 PM, Anand Jain wrote: So here is what confuses me now. :) *every* caller of btrfs_read_dev_super() is now called with 0 for the flags variable, so it never reads the backup under any circumstance. If it's always called

Re: [PATCH] btrfs-progs: print errno string when /dev/btrfs-control open fails

2013-03-14 Thread Anand Jain
I think the common pattern here is that error details follow the message, like + "skipping device registration: %s\n", I'll fix it here, if you don't mind. Pls do. Thanks David. -Anand -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the bo

Re: [PATCH 3/3 v4] btrfs-progs: disable using backup superblock by default

2013-03-15 Thread Anand Jain
So here is what confuses me now. :) *every* caller of btrfs_read_dev_super() is now called with 0 for the flags variable, so it never reads the backup under any circumstance. If it's always called w/ 0, what is the point of the argument? Is there another patch you have planned that would us

Re: btrfs_scan_one_device return error code

2013-03-17 Thread Anand Jain
As of now a common 'Invalid argument' return code is for a set of 5 errors, that is misleading from the end-user context. Albeit the proposed return error codes are the closest they might not be the perfect though. Since the idea is at least if we use 'Invalid argument' only when no bt

Re: [PATCH 3/3 v4] btrfs-progs: disable using backup superblock by default

2013-03-17 Thread Anand Jain
# mkfs.btrfs /dev/sdb /dev/sdc -f && mount /dev/sdb /btrfs # ./check-mounted /dev/sdc its btrfs /dev/sdc is currently mounted. Aborting. # dd if=/dev/zero of=/dev/sdc count=8 seek=$(((64 * 1024)/512)) # ./check-mounted /dev/sdc what is "./check-mounted?" sorry forgot to mention.. check-moun

[PATCH] btrfs-progs: return zero for success

2013-03-18 Thread Anand Jain
Signed-off-by: Anand Jain --- Makefile | 6 +- check-mounted.c | 31 +++ cmds-filesystem.c | 2 +- 3 files changed, 37 insertions(+), 2 deletions(-) create mode 100644 check-mounted.c diff --git a/Makefile b/Makefile index d102dee..c97e6b7 100644

[PATCH] btrfs-progs: defrag return zero on success

2013-03-18 Thread Anand Jain
Signed-off-by: Anand Jain --- cmds-filesystem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmds-filesystem.c b/cmds-filesystem.c index 2210020..f3d3130 100644 --- a/cmds-filesystem.c +++ b/cmds-filesystem.c @@ -446,7 +446,7 @@ static int cmd_defrag(int argc, char **argv

[PATCH] btrfs-progs: make btrfs dev scan multi path aware

2013-03-21 Thread Anand Jain
the flag O_EXCL set. This patch also includes some (error) print format changes related to the btrfs dev scan.. Signed-off-by: Anand Jain --- cmds-device.c | 53 +++-- utils.c | 31 --- 2 files changed, 63

Re: btrfs-show vs. btrfs different output

2013-03-21 Thread Anand Jain
What we really need is the right bits in the right places to let the administrator know if a device looks like it might be corrupt & in need of fixing, vs. ignoring it altogether. -- > 2. the current git btrfs-show and btrfs fi show both output > *different* devices for device with UUID > b5d

[bug] mount and /proc/mounts disagrees

2013-03-26 Thread anand jain
3.8.0+ #3 This happened after 'umount /btrfs' was interrupted by ctl-C # mount | egrep btrfs /dev/mapper/mpathe on /btrfs type btrfs (rw,degraded) # cat /etc/mtab | egrep btrfs /dev/mapper/mpathe /btrfs btrfs rw,degraded 0 0 # cat /proc/mounts | egrep btrfs # umount /btrfs umount: /btrfs: not

[PATCH] btrfs-progs: root_item generation_v2 is out of sync after btrfsck

2013-03-27 Thread Anand Jain
748f96634148 Signed-off-by: Anand Jain --- root-tree.c | 13 + 1 file changed, 13 insertions(+) diff --git a/root-tree.c b/root-tree.c index c10d068..4454147 100644 --- a/root-tree.c +++ b/root-tree.c @@ -69,6 +69,7 @@ int btrfs_update_root(struct btrfs_trans_handle *trans, struc

[PATCH 0/5 v5] access to backup-sb and btrfs' multipath aware

2013-03-27 Thread Anand Jain
easy logical understanding Anand Jain (5): btrfs-progs: make btrfs dev scan multi path aware btrfs-progs: Introduce flag BTRFS_SCAN_REGISTER to replace run_ioctl btrfs-progs: Introduce flag BTRFS_SCAN_BACKUP_SB for btrfs_read_dev_super btrfs-progs: introduce passing flags to btrfs_sca

[PATCH 2/5 v5] btrfs-progs: Introduce flag BTRFS_SCAN_REGISTER to replace run_ioctl

2013-03-27 Thread Anand Jain
Introduce flag BTRFS_SCAN_REGISTER to replace the parameter run_ioctl which controls calling the function btrfs_register_one_device(). Signed-off-by: Anand Jain --- cmds-device.c | 4 ++-- disk-io.c | 3 ++- find-root.c | 3 ++- utils.c | 17 + utils.h | 7

[PATCH 1/5 v5] btrfs-progs: make btrfs dev scan multi path aware

2013-03-27 Thread Anand Jain
the flag O_EXCL set. This patch also includes some (error) print format changes related to the btrfs dev scan.. Signed-off-by: Anand Jain --- cmds-device.c | 53 +++-- utils.c | 31 --- 2 files changed, 63

[PATCH 5/5 v5] btrfs-progs: disable using backup superblock by default

2013-03-27 Thread Anand Jain
except for check_mounted rest of the function thread should have the access to the backup SB disabled. this patch will just do that. Signed-off-by: Anand Jain --- disk-io.c | 2 +- find-root.c | 2 +- utils.c | 2 +- volumes.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions

[PATCH 4/5 v5] btrfs-progs: introduce passing flags to btrfs_scan_one_device

2013-03-27 Thread Anand Jain
backup SB disable. Signed-off-by: Anand Jain --- cmds-replace.c | 2 +- disk-io.c | 2 +- find-root.c| 3 ++- utils.c| 9 ++--- volumes.c | 2 +- volumes.h | 2 +- 6 files changed, 12 insertions(+), 8 deletions(-) diff --git a/cmds-replace.c b/cmds-replace.c index

[PATCH 3/5 v5] btrfs-progs: Introduce flag BTRFS_SCAN_BACKUP_SB for btrfs_read_dev_super

2013-03-27 Thread Anand Jain
backup SB when primary SB fails. This patch just provides the frame-work, keeping all the logic in the code same with or without this patch. Signed-off-by: Anand Jain --- disk-io.c | 10 +++--- disk-io.h | 3 ++- find-root.c | 3 ++- utils.h | 1 + volumes.c | 4 +++- 5 files

Re: [PATCH 0/5 v5] access to backup-sb and btrfs' multipath aware

2013-03-27 Thread anand jain
Any review comments on this ? pls. Thanks, Anand On 27/03/2013 18:07, Anand Jain wrote: We need a mechanism to tell when to use the backup super_block. To do this it needs a frame-work, and the patch #2 and #3 below provides the same without change in the logic. Its been found and posted

[PATCH] btrfs-progs: delete unused function get_mountpt

2013-03-31 Thread Anand Jain
and get_btrfs_mount has replaced it Signed-off-by: Anand Jain --- utils.c | 35 --- 1 file changed, 35 deletions(-) diff --git a/utils.c b/utils.c index b9b675d..0a4a971 100644 --- a/utils.c +++ b/utils.c @@ -976,41 +976,6 @@ out_mntloop_err: return ret

Re: device error stats resettable?

2013-04-01 Thread anand jain
>Is there a way to reset the device > error count? > there is -z, is it not what you are looking for ? -- # btrfs dev stat --help usage: btrfs device stats [-z] | Show current device IO stats. -z to reset stats afterwards. thanks, Anand -- To unsubscribe from this list: send the

Re: BTRFS error in __btrfs_inc_extent_ref:1935: Object already exists

2013-04-01 Thread anand jain
I tried btrfsck --repair, I am not indicating this is the cause but, kindly note that btrfsck --repair has a bug which it will let kernel to reset the uuid of the root. the fix is at: [PATCH] btrfs-progs: root_item generation_v2 is out of sync after btrfsck Thanks, Anand -- To unsubscri

[bug] btrfs fi df doesn't show raid type after balance

2013-04-02 Thread Anand Jain
Did something break.. ? we are not reporting raid type after balance. --- # btrfs fi df /btrfs Data, RAID0: total=2.00GB, used=2.03MB Data: total=8.00MB, used=0.00 System, RAID0: total=16.00MB, used=4.00KB System: total=4.00MB, used=0.00 Metadata, RAID0: total=2.00GB, used=216.00KB Meta

a scenario of use backup sb by default

2013-04-04 Thread anand jain
-- mkfs.btrfs /dev/dm-4 -f mkfs.ext4 /dev/dm-4 <-- corrupt the primary SB -- as of now -- btrfs fi label /dev/dm-4 "test" btrfs fi label /dev/dm-4 test -- is successful since its using backup super block by default, is this fine ? Thanks, Anand -- To unsubscribe from this list: send

v6: access to backup superblock

2013-04-04 Thread Anand Jain
btrfs-progs: use BTRFS_SCAN_BACKUP_SB flag in btrfs_scan_one_device Introduced a new patch [PATCH 3/3] btrfs-progs: disable using backup superblock by default v1->v2: Accepts Eric and Zach review. Separates fix into 3 patches for easy logical understanding

[PATCH 1/5] btrfs-progs: Introduce flag BTRFS_SCAN_REGISTER to replace run_ioctl

2013-04-04 Thread Anand Jain
Introduce flag BTRFS_SCAN_REGISTER to replace the parameter run_ioctl which controls calling the function btrfs_register_one_device(). Signed-off-by: Anand Jain --- cmds-device.c | 4 ++-- disk-io.c | 3 ++- find-root.c | 3 ++- utils.c | 20 +++- utils.h

[PATCH 2/5] btrfs-progs: Introduce flag BTRFS_SCAN_BACKUP_SB for btrfs_read_dev_super

2013-04-04 Thread Anand Jain
backup SB when primary SB fails. This patch just provides the frame-work, keeping all the logic in the code same with or without this patch. Signed-off-by: Anand Jain --- disk-io.c | 10 +++--- disk-io.h | 3 ++- find-root.c | 3 ++- utils.h | 1 + volumes.c | 4 +++- 5 files

[PATCH 4/5] btrfs-progs: disable using backup superblock by default

2013-04-04 Thread Anand Jain
except for check_mounted Signed-off-by: Anand Jain --- disk-io.c | 2 +- find-root.c | 2 +- utils.c | 2 +- volumes.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/disk-io.c b/disk-io.c index 82c3b66..589b37a 100644 --- a/disk-io.c +++ b/disk-io.c @@ -881,7

[PATCH 5/5] btrfs-progs: btrfs-find-root should scan backup-sb

2013-04-04 Thread Anand Jain
since idea is to scan and report all the sb in the dev, we should let it so look for backup SB by setting the flag BTRFS_SCAN_BACKUP_SB Signed-off-by: Anand Jain --- find-root.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/find-root.c b/find-root.c index 27512df

[PATCH 3/5] btrfs-progs: introduce passing flags to btrfs_scan_one_device

2013-04-04 Thread Anand Jain
backup SB disable. Signed-off-by: Anand Jain --- cmds-replace.c | 2 +- disk-io.c | 2 +- find-root.c| 3 ++- utils.c| 9 ++--- volumes.c | 2 +- volumes.h | 2 +- 6 files changed, 12 insertions(+), 8 deletions(-) diff --git a/cmds-replace.c b/cmds-replace.c index

[PATCH 0/9] a bunch of miscellaneous bug fixes

2013-04-04 Thread Anand Jain
Hi David, all kindly review/accept this patch set to fix various bugs as in the patch. This patch set is on top David's integration-20130321 branch and would apply nicely on top the backup sb fixes which was sent separately. Thanks Anand Anand Ja

[PATCH 1/9] [RESEND] btrfs-progs: root_item generation_v2 is out of sync after btrfsck

2013-04-04 Thread Anand Jain
. btrfs-debug-tree shows change in uuid < root data bytenr 29425664 level 0 dirid 0 refs 1 gen 43 < uuid 293596e8-7888-eb4c-9134-6df9db996fe5 Signed-off-by: Anand Jain --- root-tree.c | 13 + 1 file changed, 13 insertions(+) diff --git a/root-tree.c

[PATCH 3/9] btrfs-progs: mkfs should first check all disks before writing to a disk

2013-04-04 Thread Anand Jain
, RFC] btrfs-progs: overhaul mkfs.btrfs -r option Signed-off-by: Anand Jain merge with prev Signed-off-by: Anand Jain --- mkfs.c | 149 ++--- 1 file changed, 69 insertions(+), 80 deletions(-) diff --git a/mkfs.c b/mkfs.c index c8cb395

[PATCH 5/9] [RESEND] btrfs-progs: delete unused function get_mountpt

2013-04-04 Thread Anand Jain
and get_btrfs_mount has replaced it Signed-off-by: Anand Jain --- utils.c | 35 --- 1 file changed, 35 deletions(-) diff --git a/utils.c b/utils.c index 21483b8..9c5dbf4 100644 --- a/utils.c +++ b/utils.c @@ -976,41 +976,6 @@ out_mntloop_err: return ret

[PATCH 6/9] btrfs-progs: mkfs stdout print to match chronology

2013-04-04 Thread Anand Jain
After: :: fs created label (null) on /dev/dm-2 id 1 nodesize 4096 leafsize 4096 sectorsize 4096 size 59.99GB adding device /dev/dm-3 id 2 adding device /dev/dm-4 id 3 adding device /dev/dm-5 id 4 Btrfs v0.20-rc1-235-gdd21bc1 Signed-off-by: Anand Jain --- mkfs.c | 14

[PATCH 9/9] btrfs-progs: fix btrfs scrub start help

2013-04-04 Thread Anand Jain
a very trivial fix Signed-off-by: Anand Jain --- cmds-scrub.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmds-scrub.c b/cmds-scrub.c index 5922361..ebb0dc9 100644 --- a/cmds-scrub.c +++ b/cmds-scrub.c @@ -1465,7 +1465,7 @@ out: } static const char * const

[PATCH 2/9] btrfs-progs: no pending balance is not an error

2013-04-04 Thread Anand Jain
Having no balance running/ paused/completed is a normal situation, so the current output message should be positive with return val zero. As of now: Signed-off-by: Anand Jain --- cmds-balance.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cmds-balance.c b/cmds

[PATCH 4/9] btrfs-progs: check if btrfs kernel module is loaded

2013-04-04 Thread Anand Jain
when we have to report no such file error for /dev/btrfs-control we could confirm if btrfs kernel module is loaded and report it and skip registration where appropriate Further this patch pretty prints the dev scan results. Signed-off-by: Anand Jain --- cmds-device.c | 56

[PATCH 7/9] btrfs-progs: cmd replace should check target-dev fully

2013-04-04 Thread Anand Jain
this purpose __test_dev_for_mkfs is moved to utils.c and renamed to test_dev_for_mkfs Signed-off-by: Anand Jain --- cmds-replace.c | 24 ++-- mkfs.c | 122 + utils.c| 121

[PATCH 8/9] btrfs-progs: btrfs-select-super output is confusing when it fails

2013-04-04 Thread Anand Jain
Trivial patch: ./btrfs-progs/btrfs-select-super -s 0 /dev/sdc using SB copy 0, bytenr 65536 No valid Btrfs found on /dev/sdc Open ctree failed The line 'using..' is confusing which gives an indication that command is successful This patch will avoid that when command fails Signed-off

[PATCH 9/9 v2] btrfs-progs: fix btrfs scrub start help

2013-04-07 Thread Anand Jain
a very trivial fix Signed-off-by: Anand Jain --- cmds-scrub.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmds-scrub.c b/cmds-scrub.c index 5922361..32fcc20 100644 --- a/cmds-scrub.c +++ b/cmds-scrub.c @@ -1465,7 +1465,7 @@ out: } static const char * const

[PATCH 9/9 v3] btrfs-progs: fix btrfs scrub start help

2013-04-07 Thread Anand Jain
a very trivial fix Signed-off-by: Anand Jain --- cmds-scrub.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmds-scrub.c b/cmds-scrub.c index 5922361..c0dc584 100644 --- a/cmds-scrub.c +++ b/cmds-scrub.c @@ -1465,7 +1465,7 @@ out: } static const char * const

[bug] error communication from kernel to userland

2013-04-07 Thread Anand Jain
Hi, the below example tells a problem.. # btrfs dev del missing /btrfs ERROR: error removing the device 'missing' - Invalid argument # dmesg | tail :: [ 4295.258686] btrfs: unable to go below two devices on raid1 # - as of now the more accurate errors are being logged to dme

Re: [PATCH] btrfs-progs: make btrfs dev scan multi path aware

2013-04-09 Thread Anand Jain
On 04/08/2013 11:22 PM, David Sterba wrote: On Thu, Mar 21, 2013 at 07:56:44PM +0800, Anand Jain wrote: We should avoid using non multi-path (mp) path for mp disks As of now there is no good way (like api) to check that. A workaround way is to check if the O_EXCL open is unsuccessful

Re: [PATCH] btrfs-progs: make btrfs dev scan multi path aware

2013-04-09 Thread Anand Jain
On 04/09/2013 07:12 PM, David Sterba wrote: On Mon, Apr 08, 2013 at 05:22:38PM +0200, David Sterba wrote: + fd = open("/dev/btrfs-control", O_RDWR); + e = errno; + if (fd < 0) { + FILE *mfd = popen("lsmod | grep btrfs", "r"); Please transform this into C. Act

[PATCH 4/9 v2] btrfs-progs: check if btrfs kernel module is loaded

2013-04-10 Thread Anand Jain
when we have to report no such file error for /dev/btrfs-control we could confirm if btrfs kernel is present and report it and skip registration where appropriate v1->v2: use /proc/filesystems to check if the btrfs is present Signed-off-by: Anand Jain --- cmds-device.c |

Re: [obsoleted] [PATCH 1/5 v5] btrfs-progs: make btrfs dev scan multi path aware

2013-04-11 Thread Anand Jain
This patch is replaced By: btrfs-progs: avoid ioctl for multipath-dev with its non-multipath path which is also sent to this mailing list. thanks, Anand On 03/27/2013 06:07 PM, Anand Jain wrote: We should avoid using non multi-path (mp) path for mp disks As of now there is no good

[PATCH] btrfs-progs: avoid ioctl for multipath-dev with its non-multipath path

2013-04-11 Thread Anand Jain
flag O_EXCL set. Signed-off-by: Anand Jain --- utils.c | 30 +- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/utils.c b/utils.c index 3308668..0231677 100644 --- a/utils.c +++ b/utils.c @@ -1105,6 +1105,13 @@ again: if (!S_ISBLK(st.st_mode

[PATCH] btrfs-progs: a copy of superblock is zero may not mean btrfs is not there

2013-04-12 Thread Anand Jain
v/sdc /dev/sdc is currently mounted. Aborting. Signed-off-by: Anand Jain --- disk-io.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/disk-io.c b/disk-io.c index 589b37a..3f85c21 100644 --- a/disk-io.c +++ b/disk-io.c @@ -1138,9 +1138,12 @@ int btrfs_read_dev_super(i

Re: [PATCH 2/9] btrfs-progs: no pending balance is not an error

2013-04-14 Thread Anand Jain
On 04/12/2013 11:57 PM, David Sterba wrote: On Fri, Apr 05, 2013 at 01:54:56PM +0800, Anand Jain wrote: --- a/cmds-balance.c +++ b/cmds-balance.c @@ -662,8 +662,12 @@ static int cmd_balance_status(int argc, char **argv) close(fd); if (ret < 0) { + if

[PATCH 00/11 v2] a bunch of miscellaneous bug fixes

2013-04-14 Thread Anand Jain
v1->v2: Accepts the review comments from David Accepts the review comments from Stefan Rebase changes Adds the 10/11 and 11/11 which was outside this patch-set Anand Jain (11): btrfs-progs: root_item generation_v2 is out of sync after btrfsck btrfs-progs:

[PATCH 01/11, RESEND] btrfs-progs: root_item generation_v2 is out of sync after btrfsck

2013-04-14 Thread Anand Jain
. btrfs-debug-tree shows change in uuid < root data bytenr 29425664 level 0 dirid 0 refs 1 gen 43 < uuid 293596e8-7888-eb4c-9134-6df9db996fe5 Signed-off-by: Anand Jain --- root-tree.c | 13 + 1 file changed, 13 insertions(+) diff --git a/root-tree.c

[PATCH 02/11, RESEND] btrfs-progs: no pending balance is not an error

2013-04-14 Thread Anand Jain
Having no balance running/ paused/completed is a normal situation, so the current output message should be positive with return val zero. Signed-off-by: Anand Jain --- cmds-balance.c | 16 +--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/cmds-balance.c b/cmds

[PATCH 03/11 v2] btrfs-progs: mkfs should first check all disks before writing to a disk

2013-04-14 Thread Anand Jain
, RFC] btrfs-progs: overhaul mkfs.btrfs -r option Signed-off-by: Anand Jain to merg prev Signed-off-by: Anand Jain --- mkfs.c | 192 +++- utils.c | 128 +++ utils.h | 1 + 3 files changed, 161

[PATCH 07/11, RESEND] btrfs-progs: delete unused function get_mountpt

2013-04-14 Thread Anand Jain
and get_btrfs_mount has replaced it Signed-off-by: Anand Jain --- utils.c | 35 --- 1 file changed, 35 deletions(-) diff --git a/utils.c b/utils.c index 67419da..926421c 100644 --- a/utils.c +++ b/utils.c @@ -977,41 +977,6 @@ out_mntloop_err: return ret

[PATCH 09/11, RESEND] btrfs-progs: fix btrfs scrub start help

2013-04-14 Thread Anand Jain
a very trivial fix Signed-off-by: Anand Jain --- cmds-scrub.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmds-scrub.c b/cmds-scrub.c index 5922361..c0dc584 100644 --- a/cmds-scrub.c +++ b/cmds-scrub.c @@ -1465,7 +1465,7 @@ out: } static const char * const

[PATCH 11/11, RESEND] btrfs-progs: a copy of superblock is zero may not mean btrfs is not there

2013-04-14 Thread Anand Jain
v/sdc /dev/sdc is currently mounted. Aborting. Signed-off-by: Anand Jain --- disk-io.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/disk-io.c b/disk-io.c index 589b37a..3f85c21 100644 --- a/disk-io.c +++ b/disk-io.c @@ -1138,9 +1138,12 @@ int btrfs_read_dev_super(i

[PATCH 10/11, RESEND] btrfs-progs: avoid ioctl for multipath-dev with its non-multipath path

2013-04-14 Thread Anand Jain
flag O_EXCL set. Signed-off-by: Anand Jain --- utils.c | 30 +- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/utils.c b/utils.c index 926421c..158912c 100644 --- a/utils.c +++ b/utils.c @@ -1105,6 +1105,13 @@ again: if (!S_ISBLK(st.st_mode

[PATCH 06/11, v2] btrfs-progs: check if btrfs kernel module is loaded

2013-04-14 Thread Anand Jain
when we have to report no such file error for /dev/btrfs-control we could confirm if btrfs kernel is present and report it and skip registration where appropriate v1->v2: use /proc/filesystems to check if the btrfs is present Signed-off-by: Anand Jain --- cmds-device.c |

[PATCH 08/11, RESEND] btrfs-progs: btrfs-select-super output is confusing when it fails

2013-04-14 Thread Anand Jain
Trivial patch: ./btrfs-progs/btrfs-select-super -s 0 /dev/sdc using SB copy 0, bytenr 65536 No valid Btrfs found on /dev/sdc Open ctree failed The line 'using..' is confusing which gives an indication that command is successful This patch will avoid that when command fails Signed-off

[PATCH 04/11 v2] btrfs-progs: cmd replace should check target-dev fully

2013-04-14 Thread Anand Jain
-by: Anand Jain --- cmds-replace.c | 23 --- 1 file changed, 4 insertions(+), 19 deletions(-) diff --git a/cmds-replace.c b/cmds-replace.c index ab34388..4e881b7 100644 --- a/cmds-replace.c +++ b/cmds-replace.c @@ -137,12 +137,11 @@ static int cmd_start_replace(int argc, char

[PATCH 05/11, RESEND] btrfs-progs: mkfs stdout print to match chronology

2013-04-14 Thread Anand Jain
After: :: fs created label (null) on /dev/dm-2 id 1 nodesize 4096 leafsize 4096 sectorsize 4096 size 59.99GB adding device /dev/dm-3 id 2 adding device /dev/dm-4 id 3 adding device /dev/dm-5 id 4 Btrfs v0.20-rc1-235-gdd21bc1 Signed-off-by: Anand Jain --- mkfs.c | 14

Re: [PATCH 02/11, v2] btrfs-progs: no pending balance is not an error

2013-04-14 Thread Anand Jain
Oh. this title prefix should be v2 not RESEND. v1->v2 Accepts David review comments Thanks, Anand On 04/15/2013 02:38 PM, Anand Jain wrote: Having no balance running/ paused/completed is a normal situation, so the current output message should be positive with return val zero. Signed-

Re: [PATCH 3/9] btrfs-progs: mkfs should first check all disks before writing to a disk

2013-04-14 Thread Anand Jain
On 04/13/2013 12:06 AM, David Sterba wrote: On Fri, Apr 05, 2013 at 01:54:57PM +0800, Anand Jain wrote: In the cases where one of the disk is not suitable for btrfs, then we would fail the mkfs, however we determine that after we have written btrfs to the preceding disks. At this time if user

[PATCH 06/11 v3] btrfs-progs: check if btrfs kernel module is loaded

2013-04-15 Thread Anand Jain
when we have to report no such file error for /dev/btrfs-control we could confirm if btrfs kernel is present and report it and skip registration where appropriate v2->v3: accept review comments from David v1->v2: use /proc/filesystems to check if the btrfs is present Signed-off-by:

Re: [PATCH 4/9 v2] btrfs-progs: check if btrfs kernel module is loaded

2013-04-15 Thread Anand Jain
On 04/13/2013 12:23 AM, David Sterba wrote: On Wed, Apr 10, 2013 at 04:23:21PM +0800, Anand Jain wrote: diff --git a/cmds-device.c b/cmds-device.c index a90fb67..0e1e6de 100644 --- a/cmds-device.c +++ b/cmds-device.c @@ -185,9 +185,10 @@ static const char * const cmd_scan_dev_usage

[PATCH 02/11 v3] btrfs-progs: no pending balance is not an error

2013-04-15 Thread Anand Jain
Having no balance running/ paused/completed is a normal situation, so the current output message should be positive with return val zero. Signed-off-by: Anand Jain --- cmds-balance.c | 18 ++ 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/cmds-balance.c b/cmds

Re: [PATCH 02/11, RESEND] btrfs-progs: no pending balance is not an error

2013-04-15 Thread Anand Jain
On 04/16/2013 12:21 AM, David Sterba wrote: On Mon, Apr 15, 2013 at 02:38:08PM +0800, Anand Jain wrote: +/* Checks the status of the balance if any + * return codes: + * -1 : Error failed to know if there is any pending balance + * 1 : Successful to know status of a pending balance

[PATCH] btrfs-progs: delete unused function btrfs_read_super_device

2013-04-16 Thread Anand Jain
Signed-off-by: Anand Jain --- volumes.c | 9 - 1 file changed, 9 deletions(-) diff --git a/volumes.c b/volumes.c index b555ded..7a9b6f0 100644 --- a/volumes.c +++ b/volumes.c @@ -1643,15 +1643,6 @@ static int read_one_dev(struct btrfs_root *root, return ret; } -int

<    1   2   3   4   5   6   7   8   9   10   >