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] path|device Show current device IO stats. -z to reset stats afterwards. thanks, Anand -- To unsubscribe from this list:

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

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

2013-04-03 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

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_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 Anand Jain (5

[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 anand.j...@oracle.com --- cmds-device.c | 4 ++-- disk-io.c | 3 ++- find-root.c | 3 ++- utils.c | 20

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

2013-04-04 Thread Anand Jain
for the 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 anand.j...@oracle.com --- disk-io.c | 10 +++--- disk-io.h | 3 ++- find-root.c | 3 ++- utils.h | 1 + volumes.c

[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 anand.j...@oracle.com --- 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

[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 anand.j...@oracle.com --- find-root.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/find-root.c b/find

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

2013-04-04 Thread Anand Jain
to backup SB disable. Signed-off-by: Anand Jain anand.j...@oracle.com --- 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

[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 Jain (9

[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 anand.j...@oracle.com --- root-tree.c | 13 + 1 file changed, 13 insertions(+) diff --git a/root

[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 anand.j...@oracle.com merge with prev Signed-off-by: Anand Jain anand.j...@oracle.com --- mkfs.c | 149 ++--- 1 file changed, 69 insertions(+), 80 deletions

[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 anand.j...@oracle.com --- 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

[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 anand.j...@oracle.com

[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 anand.j...@oracle.com --- 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

[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 anand.j...@oracle.com --- cmds-balance.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/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 anand.j...@oracle.com --- cmds-device.c | 56

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

2013-04-04 Thread Anand Jain
for this purpose __test_dev_for_mkfs is moved to utils.c and renamed to test_dev_for_mkfs Signed-off-by: Anand Jain anand.j...@oracle.com --- 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-by: Anand

[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 anand.j...@oracle.com --- 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

[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 anand.j...@oracle.com --- 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

[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

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. Actually,

[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 anand.j...@oracle.com --- cmds-device.c | 56

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
with the flag O_EXCL set. Signed-off-by: Anand Jain anand.j...@oracle.com --- 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

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

2013-04-12 Thread Anand Jain
/dev/sdc is currently mounted. Aborting. Signed-off-by: Anand Jain anand.j...@oracle.com --- 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

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 (e

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

2013-04-15 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-15 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 anand.j...@oracle.com --- root-tree.c | 13 + 1 file changed, 13 insertions(+) diff --git a/root

[PATCH 02/11, RESEND] 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 anand.j...@oracle.com --- cmds-balance.c | 16 +--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/cmds

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

2013-04-15 Thread Anand Jain
, RFC] btrfs-progs: overhaul mkfs.btrfs -r option Signed-off-by: Anand Jain anand.j...@oracle.com to merg prev Signed-off-by: Anand Jain anand.j...@oracle.com --- mkfs.c | 192 +++- utils.c | 128

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

2013-04-15 Thread Anand Jain
and get_btrfs_mount has replaced it Signed-off-by: Anand Jain anand.j...@oracle.com --- 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

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

2013-04-15 Thread Anand Jain
a very trivial fix Signed-off-by: Anand Jain anand.j...@oracle.com --- 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

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

2013-04-15 Thread Anand Jain
/dev/sdc is currently mounted. Aborting. Signed-off-by: Anand Jain anand.j...@oracle.com --- 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

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

2013-04-15 Thread Anand Jain
with the flag O_EXCL set. Signed-off-by: Anand Jain anand.j...@oracle.com --- 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

[PATCH 06/11, v2] 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 v1-v2: use /proc/filesystems to check if the btrfs is present Signed-off-by: Anand Jain anand.j...@oracle.com --- cmds-device.c | 60

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

2013-04-15 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-by: Anand

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

2013-04-15 Thread Anand Jain
-by: Anand Jain anand.j...@oracle.com --- 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

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

2013-04-15 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 anand.j...@oracle.com

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

2013-04-15 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-off

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

2013-04-15 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: Anand

[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 anand.j...@oracle.com --- cmds-balance.c | 18 ++ 1 file changed, 14 insertions(+), 4 deletions(-) diff --git

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 anand.j...@oracle.com --- 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

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

2013-04-16 Thread Anand Jain
On 04/16/2013 07:57 PM, David Sterba wrote: On Fri, Apr 12, 2013 at 03:55:06PM +0800, Anand Jain wrote: If one of the copy of the superblock is zero it does not confirm to us that btrfs isn't there on that disk. When we are having more than one copy of superblock we should rather let

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

2013-04-18 Thread Anand Jain
If one of the copy of the superblock is zero it does not confirm to us that btrfs isn't there on that disk. When we are having more than one copy of superblock we should rather let the for loop to continue to check other copies. the following test case and results would justify the fix

Re: (3.9-rc5) WARNING: at fs/btrfs/super.c:255 __btrfs_abort_transaction

2013-04-19 Thread Anand Jain
Another reproducer is reporting the same effect. as below. mkfs.btrfs /dev/dm-2 /dev/dm-4 -f -m raid1 -d raid1 x=0 0 3 0; echo scsi remove-single-device $x /proc/scsi/scsi mount -o degraded /dev/dm-2 /btrfs btrfs fi show Label: none uuid: 8ae8e37e-9f04-4a90-9c85-0c75a7622405

[PATCH] btrfs-progs: subvol show could take more than one subvol

2013-04-19 Thread Anand Jain
Signed-off-by: Anand Jain anand.j...@oracle.com --- cmds-subvolume.c | 12 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/cmds-subvolume.c b/cmds-subvolume.c index 74e2130..e3b8032 100644 --- a/cmds-subvolume.c +++ b/cmds-subvolume.c @@ -800,16 +800,18 @@ static int

Re: [PATCH 1/2] btrfs-progs: set generation_v2 any time we write a new root

2013-04-22 Thread Anand Jain
yeah we should set the v2 parameter at all the place where we call btrfs_set_root_generation. Sorry it slipped my mind. Thanks for the fix. Thanks, Anand On 04/22/2013 01:01 PM, Eric Sandeen wrote: With this integration branch commit in place: 2bd1169 btrfs-progs: root_item

Re: [PATCH 2/2 V2] btrfs-progs: update generation_v2 in btrfs_update_root

2013-04-22 Thread Anand Jain
/* - * If the btrfs-progs is newer and kernel is at - * generation_v1 then we don't touch v2 items - * otherwise when kernel is at same or greater - * version compared with btrfs-progs then update - * the needed - */ - old_size =

[PATCH] btrfs-progs: mkfs seg fault for wrong free

2013-04-25 Thread Anand Jain
With commit 87c09f7 Btrfs-progs: fix memory leaks on cleanup mkfs on multiple dev is ending with segfault at close_all_devices() during kfree(device-name) because mkfs calls btrfs_add_to_fsid, which does not initialize name when dev is added to the list. Signed-off-by: Anand Jain

[PATCH v2] btrfs-progs: mkfs seg fault for wrong free

2013-04-25 Thread Anand Jain
With commit 87c09f7 Btrfs-progs: fix memory leaks on cleanup mkfs on multiple dev is ending with segfault at close_all_devices() during kfree(device-name) because mkfs calls btrfs_add_to_fsid, which does not initialize name when dev is added to the list. Signed-off-by: Anand Jain

device delete to get errors from the kernel

2013-04-26 Thread Anand Jain
As showed in the previous email in this thread, we need to get the error string from the kernel to the cli to improve the usability of the product. As also said, I was looking at two way which I think we could do this, here I take the 2nd approach which is to pass the error string though

[PATCH] btrfs-progs: device delete to get errors from the kernel

2013-04-26 Thread Anand Jain
add another parameter to the ioctl arg structure to carry the error string Signed-off-by: Anand Jain anand.j...@oracle.com --- cmds-device.c | 13 + ioctl.h | 9 - 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/cmds-device.c b/cmds-device.c index

[PATCH] btrfs: device delete to get errors from the kernel

2013-04-26 Thread Anand Jain
adds a parameter in the ioctl arg struct to carry the error string Signed-off-by: Anand Jain anand.j...@oracle.com --- fs/btrfs/ioctl.c | 42 +++--- fs/btrfs/volumes.c | 29 +++-- fs/btrfs/volumes.h | 2

Re: [PATCH] btrfs: device delete to get errors from the kernel

2013-04-29 Thread Anand Jain
If you want to make this give you more specific errors then adjust the errno's we send back and make the userspace util translate those to their appropriate error. Thanks, Thats the approach #1 as listed before in this mail thread, let me give a try. Anand -- To unsubscribe from this

Re: device delete to get errors from the kernel

2013-04-30 Thread Anand Jain
Thanks Stefan. :: About the issue you mentioned, that you need to change the kernel and the user mode at the same time: You can keep it compatible. Just do not delete the old kernel interface. The user mode program could try the new interface first, and if it fails, fall back to the old

Re: device delete to get errors from the kernel

2013-04-30 Thread Anand Jain
, Anand On 04/26/2013 05:39 PM, Anand Jain wrote: As showed in the previous email in this thread, we need to get the error string from the kernel to the cli to improve the usability of the product. As also said, I was looking at two way which I think we could do this, here I take the 2nd

[PATCH v2] btrfs: device delete to get errors from the kernel

2013-04-30 Thread Anand Jain
v1-v2: introduce error codes for the device mgmt usage v1: adds a parameter in the ioctl arg struct to carry the error string Signed-off-by: Anand Jain anand.j...@oracle.com --- fs/btrfs/ioctl.c | 22 +++--- fs/btrfs/volumes.c | 26

[PATCH v2] btrfs-progs: device delete to get errors from the kernel

2013-04-30 Thread Anand Jain
v1-v2: introduce error codes for the device mgmt usage v1: add another parameter to the ioctl arg structure to carry the error string Signed-off-by: Anand Jain anand.j...@oracle.com --- cmds-device.c | 10 -- ioctl.h | 37 + 2 files changed, 45

[PATCH 1/2] btrfs-progs: device scan use BTRFS_SCAN_LBLKID by default

2013-10-11 Thread Anand Jain
. (it was inconsistent (across disks) because btrfs dev scan provided a different path from the mount command eg. below) devid1 size 1.98GiB used 435.00MiB path /dev/mapper/mpatha devid2 size 2.00GiB used 415.00MiB path /dev/dm-1 Signed-off-by: Anand Jain anand.j...@oracle.com --- cmds-device.c

[PATCH 2/2] btrfs-progs: use the marco BTRFS_UPDATE_KERNEL where needed

2013-10-11 Thread Anand Jain
Signed-off-by: Anand Jain anand.j...@oracle.com --- cmds-device.c |2 +- utils.c |2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cmds-device.c b/cmds-device.c index 1315918..6f32356 100644 --- a/cmds-device.c +++ b/cmds-device.c @@ -203,7 +203,7 @@ static int

Re: [PATCH 2/3 v2] btrfs-progs: add more parameter to the filesystem show

2013-10-15 Thread Anand Jain
preview as below.. Label: none uuid: 26d539a5-8968-4cf0-b4b5-5fd50105f8a0 mounted: /btrfs Group profile: Metadata: single Metadata: DUP Data: single It would look better if the profile types are grouped together, As of now mkfs.btrfs and balance don't agree on the same set of

Re: [PATCH 1/3 v4] btrfs-progs: use kernel for mounted disk for show

2013-10-16 Thread Anand Jain
The reason is simple, for my convenience I've added the user to the 'disk' group so I can access the block devices without root. This patch stops to read the block devs directly and uses the ioctl BTRFS_IOC_FS_INFO which gives me a silent EPERM. If I run show with sudo, then all filesystems

[PATCH 1/2] btrfs-progs: make get_btrfs_mount callable

2013-10-21 Thread Anand Jain
get_btrfs_mount is reusable function but it is printing errors, this removes it. Here the parent function of open_path_or_dev_mnt does print error msg on error. Signed-off-by: Anand Jain anand.j...@oracle.com --- utils.c |6 ++ utils.h |1 + 2 files changed, 3 insertions(+), 4

[PATCH 2/2] btrfs-progs: filesystem show of specified mounted disk should work

2013-10-21 Thread Anand Jain
Originally, thinking was user will use mount point if the disk is mounted. But thats not really true, actually user don't (or shouldn't) care to check if disk mounted, so whether disk is mounted/unmounted when disk path is specified it should work. Signed-off-by: Anand Jain anand.j...@oracle.com

Re: [PATCH 1/3 v4] btrfs-progs: use kernel for mounted disk for show

2013-10-21 Thread Anand Jain
On 10/21/13 10:44 PM, Josef Bacik wrote: On Tue, Oct 15, 2013 at 07:13:33PM +0200, David Sterba wrote: On Tue, Oct 08, 2013 at 11:41:38AM +0800, Anand Jain wrote: As of now btrfs filesystem show reads directly from disks. So sometimes output can be stale, mainly when user wants to cross

Re: [PATCH 2/2] btrfs-progs: filesystem show of specified mounted disk should work

2013-10-22 Thread Anand Jain
As I remember, there was no code to handle the look up by label. it was a dummy option which did nothing. So the below commit removed the option. -- commit 50eaae45f2b47643f9a4c43ce72f7d6e06d4e323 Author: Anand Jain anand.j...@oracle.com Date: Mon Jul 15 13:30:48 2013 +0800 btrfs

Re: [PATCH 2/2] btrfs-progs: filesystem show of specified mounted disk should work

2013-10-22 Thread Anand Jain
On 10/22/13 10:33 PM, David Sterba wrote: On Tue, Oct 22, 2013 at 01:53:22PM +0800, Anand Jain wrote: @@ -386,7 +395,7 @@ static int btrfs_scan_kernel(void *search) static const char * const cmd_show_usage[] = { - btrfs filesystem show [options] [path|uuid], + btrfs filesystem

Re: [PATCH 1/2] btrfs-progs: make get_btrfs_mount callable

2013-10-22 Thread Anand Jain
On 10/22/13 10:43 PM, David Sterba wrote: On Tue, Oct 22, 2013 at 01:53:21PM +0800, Anand Jain wrote: get_btrfs_mount is reusable function but it is printing errors, this removes it. Here the parent function of open_path_or_dev_mnt does print error msg on error. Yeah, but then each caller

Re: [PATCH 1/3 v4] btrfs-progs: use kernel for mounted disk for show

2013-10-23 Thread Anand Jain
On 10/23/13 12:52 AM, David Sterba wrote: On Tue, Oct 22, 2013 at 09:21:47AM -0400, Josef Bacik wrote: Did you test these? Because they aren't working for me, so I think a revert is the only solution. Thanks, The impact of the failing test is imho not that big to justify a full revert

Re: [PATCH 1/3 v4] btrfs-progs: use kernel for mounted disk for show

2013-10-23 Thread Anand Jain
On 10/23/13 12:52 AM, David Sterba wrote: On Tue, Oct 22, 2013 at 09:21:47AM -0400, Josef Bacik wrote: Did you test these? Because they aren't working for me, so I think a revert is the only solution. Thanks, The impact of the failing test is imho not that big to justify a full revert

[PATCH] btrfs-progs: make filesystem show by label work

2013-10-24 Thread Anand Jain
with design revamp around filesystem show the fsid filter by label wasn't planned. but apparently that seemed to be necessary. this patch will fix it. Signed-off-by: Anand Jain anand.j...@oracle.com --- cmds-filesystem.c | 120 - 1 files

[PATCH 1/2] btrfs-progs: mechanism to fetch fsinfo from btrfs-control

2013-10-25 Thread Anand Jain
is planned. Signed-off-by: Anand Jain anand.j...@oracle.com --- ioctl.h | 19 +++ utils.c | 80 +++ utils.h |1 + 3 files changed, 100 insertions(+), 0 deletions(-) diff --git a/ioctl.h b/ioctl.h index d21413f..29575d8

[PATCH 2/2] btrfs-progs: fs show should handle if subvol(s) mounted

2013-10-25 Thread Anand Jain
as of now with out this patch user would see fsinfo per btrfs mount path but which mean multiple entry if more than one subvol is mounted of the same fsid. so this patch will handle that nicely. Signed-off-by: Anand Jain anand.j...@oracle.com --- cmds-filesystem.c | 90

[PATCH] btrfs: add framework to read fs info from btrfs-control

2013-10-25 Thread Anand Jain
This adds ioctl BTRFS_IOC_GET_FSIDS which reads the fs info through the btrfs-control Signed-off-by: Anand Jain anand.j...@oracle.com --- fs/btrfs/super.c | 47 ++- fs/btrfs/volumes.c | 33 ++ fs/btrfs

[PATCH 2/3 v2] btrfs-progs: mechanism to fetch fsinfo from btrfs-control

2013-10-29 Thread Anand Jain
-by: Anand Jain anand.j...@oracle.com --- ioctl.h | 19 +++ utils.c | 80 +++ utils.h |1 + 3 files changed, 100 insertions(+), 0 deletions(-) diff --git a/ioctl.h b/ioctl.h index d21413f..29575d8 100644 --- a/ioctl.h +++ b

[PATCH] btrfs-progs: lblkid wouldn't find non mapper path input

2013-10-29 Thread Anand Jain
. Signed-off-by: Anand Jain anand.j...@oracle.com --- cmds-filesystem.c | 52 +--- 1 files changed, 49 insertions(+), 3 deletions(-) diff --git a/cmds-filesystem.c b/cmds-filesystem.c index fcabdb0..3a494fd 100644 --- a/cmds-filesystem.c +++ b/cmds

[PATCH] btrfs: add framework to read fs info from btrfs-control

2013-11-03 Thread Anand Jain
This adds ioctl BTRFS_IOC_GET_FSIDS which reads the fs info through the btrfs-control v2: accepts Zach suggested now holds uuid_mutex Signed-off-by: Anand Jain anand.j...@oracle.com --- fs/btrfs/super.c | 66 fs/btrfs/volumes.c

[PATCH 4/4] btrfs-progs: lblkid wouldn't find non mapper path input

2013-11-03 Thread Anand Jain
: accepts Josef suggested Signed-off-by: Anand Jain anand.j...@oracle.com --- cmds-filesystem.c | 59 +--- 1 files changed, 55 insertions(+), 4 deletions(-) diff --git a/cmds-filesystem.c b/cmds-filesystem.c index f8e8475..f40178a 100644 --- a/cmds

[PATCH 3/4 v2] btrfs-progs: fs show should handle if subvol(s) mounted

2013-11-03 Thread Anand Jain
as of now with out this patch user would see fsinfo per btrfs mount path but which mean multiple entry if more than one subvol is mounted of the same fsid. so this patch will handle that nicely. v2: accepts Zach suggested Signed-off-by: Anand Jain anand.j...@oracle.com --- cmds-filesystem.c

[PATCH 1/4] btrfs-progs: make filesystem show by label work

2013-11-03 Thread Anand Jain
with design revamp around filesystem show the fsid filter by label wasn't planned. but apparently that seemed to be necessary. this patch will fix it. Signed-off-by: Anand Jain anand.j...@oracle.com --- cmds-filesystem.c | 120 - 1 files

[PATCH 2/4 v2] btrfs-progs: mechanism to fetch fsinfo from btrfs-control

2013-11-03 Thread Anand Jain
-by: Anand Jain anand.j...@oracle.com --- ioctl.h | 19 +++ utils.c | 80 +++ utils.h |1 + 3 files changed, 100 insertions(+), 0 deletions(-) diff --git a/ioctl.h b/ioctl.h index d21413f..29575d8 100644 --- a/ioctl.h +++ b

Re: [PATCH] btrfs: add framework to read fs info from btrfs-control

2013-11-03 Thread Anand Jain
(sorry for the delay, various external issues) I have sent out the new patch set. Thanks for the comments. more inline. On 10/30/13 05:33 AM, Zach Brown wrote: This adds ioctl BTRFS_IOC_GET_FSIDS which reads the fs info through the btrfs-control Why not use sysfs? various sysfs

Re: [PATCH] btrfs-progs: lblkid wouldn't find non mapper path input

2013-11-03 Thread Anand Jain
Thanks for the comments. Sorry for the delay. more inline below. V2 has been sent out. On 10/30/13 12:40 AM, Josef Bacik wrote: On Wed, Oct 30, 2013 at 12:34:50AM +0800, Anand Jain wrote: A new test case when disk is unmounted and if the non mapper disk path is given as the argument

[PATCH v2] btrfs: add framework to read fs info from btrfs-control

2013-11-03 Thread Anand Jain
This adds ioctl BTRFS_IOC_GET_FSIDS which reads the fs info through the btrfs-control v2: accepts Zach suggested now holds uuid_mutex Signed-off-by: Anand Jain anand.j...@oracle.com --- fs/btrfs/super.c | 66 fs/btrfs/volumes.c

[PATCH 4/4 v2] btrfs-progs: lblkid wouldn't find non mapper path input

2013-11-03 Thread Anand Jain
: accepts Josef suggested Signed-off-by: Anand Jain anand.j...@oracle.com --- cmds-filesystem.c | 59 +--- 1 files changed, 55 insertions(+), 4 deletions(-) diff --git a/cmds-filesystem.c b/cmds-filesystem.c index f8e8475..f40178a 100644 --- a/cmds

Re: [PATCH 02/16] btrfs-progs: fix error returns in get_df()

2013-11-06 Thread Anand Jain
I had just retained whats in the original. But this is good change. Thanks Eric. Reviewed-by: Anand Jain anand.j...@oracle.com On 11/07/2013 07:15 AM, Eric Sandeen wrote: get_df returns -ERRNO, or maybe (+)errno, or even 0 in the case where we inexplicably got 0 total_spaces from

[PATCH] btrfs-progs: use strncpy in btrfs_scan_lblkid()

2013-11-06 Thread Anand Jain
From: Eric Sandeen sand...@redhat.com Use strncpy(... ,PATH_MAX) to be sure we don't overflow the path[PATH_MAX] array. Resolves-Coverity-CID: 1125941 Signed-off-by: Eric Sandeen sand...@redhat.com Signed-off-by: Anand Jain anand.j...@oracle.com --- utils.c |4 ++-- 1 files changed, 2

[PATCH] btrfs-progs: use /proc/self/mounts

2013-11-06 Thread Anand Jain
Signed-off-by: Anand Jain anand.j...@oracle.com --- cmds-send.c |2 +- utils.c |2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cmds-send.c b/cmds-send.c index 53e9a53..43ea06b 100644 --- a/cmds-send.c +++ b/cmds-send.c @@ -72,7 +72,7 @@ int find_mount_root(const

Re: [PATCH 04/16] btrfs-progs: fix test for return of realpath in find_mount_root()

2013-11-06 Thread Anand Jain
Reviewed-by: Anand Jain anand.j...@oracle.com On 11/07/2013 07:15 AM, Eric Sandeen wrote: find_mount_root() tries to test for realpath() failure, but tests the wrong value. Fix it. Resolves-Coverity-CID: 1125940 Signed-off-by: Eric Sandeen sand...@redhat.com --- cmds-send.c |2 +- 1

Re: [PATCH 05/16] btrfs-progs: don't leak fd in test_dev_for_mkfs() error paths

2013-11-06 Thread Anand Jain
Reviewed-by: Anand Jain anand.j...@oracle.com On 11/07/2013 07:15 AM, Eric Sandeen wrote: Close fd before we return on error paths. Resolves-Coverity-CID: 1125939 Signed-off-by: Eric Sandeen sand...@redhat.com --- utils.c |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff

Re: [PATCH 09/16] btrfs-progs: btrfs_scan_kernel(): fd==0 is not an error

2013-11-06 Thread Anand Jain
Reviewed-by: Anand Jain anand.j...@oracle.com On 11/07/2013 07:15 AM, Eric Sandeen wrote: The error return from open is -1, so test that, not 0, for success/failure. Resolves-Coverity-CID: 1125931 Signed-off-by: Eric Sandeen sand...@redhat.com --- cmds-filesystem.c |4 ++-- 1 files

Re: [PATCH 11/16] btrfs-progs: pass positive errno to strerror in cmd_df()

2013-11-06 Thread Anand Jain
Reviewed-by Anand Jain anand.j...@oracle.com On 11/07/2013 07:15 AM, Eric Sandeen wrote: get_df returns a negative error number, but then we pass it to strerror, which wants a positive value... Resolves-Coverity-CID: 1125929 Signed-off-by: Eric Sandeen sand...@redhat.com --- cmds

Re: [PATCH 13/16] btrfs-progs: check btrfs_scan_one_device in btrfs_scan_lblkid()

2013-11-07 Thread Anand Jain
reviewed-by: Anand Jain anand.j...@oracle.com On 11/07/2013 07:15 AM, Eric Sandeen wrote: Even if it's definitely btrfs at this point, btrfs_scan_one_device could fail for other reasons. Check the return value, warn if it fails, and skip the device register. Resolves-Coverity-CID: 1125925

[PATCH 3/3] btrfs-progs: lblkid wouldn't find non mapper path input v3

2013-11-07 Thread Anand Jain
: accepts Josef suggested v2: accepts Josef suggested Signed-off-by: Anand Jain anand.j...@oracle.com --- cmds-filesystem.c | 59 +--- 1 files changed, 55 insertions(+), 4 deletions(-) diff --git a/cmds-filesystem.c b/cmds-filesystem.c index

<    4   5   6   7   8   9   10   11   12   13   >