[PATCH 08/10] Btrfs-progs: make printing subvol extensible to newer layouts

2013-01-27 Thread Anand Jain
Currently you can print subvol in a list or table format. This patch will provide a way to extend this to other formats like the upcoming raw format. Signed-off-by: Anand Jain anand.j...@oracle.com --- btrfs-list.c | 26 +++--- btrfs-list.h | 3 +++ cmds-subvolume.c

[PATCH 09/10] Btrfs-progs: make get_subvol_name non cmds-send specific

2013-01-27 Thread Anand Jain
get_subvol_name can be used other than the just with in cmds-send.c so this patch will make it possible with out changing the original intentions. Signed-off-by: Anand Jain anand.j...@oracle.com --- cmds-send.c | 12 ++-- commands.h | 1 + 2 files changed, 7 insertions(+), 6 deletions

[PATCH 10/10] Btrfs-progs: add show subcommand to subvol cli

2013-01-27 Thread Anand Jain
This adds show sub-command to the btrfs subvol cli to display detailed inforamtion of the given subvol or snapshot. Signed-off-by: Anand Jain anand.j...@oracle.com --- btrfs-list.c | 25 +++-- btrfs-list.h | 3 +- cmds-subvolume.c | 155

[PATCH 05/10] Btrfs-progs: add function btrfs_get_subvol to get root_info of a subvol

2013-01-27 Thread Anand Jain
We need a function which can get the root_info of a given subvol. This is in preparation to add support for the show sub-cli. Signed-off-by: Anand Jain anand.j...@oracle.com --- btrfs-list.c | 38 ++ btrfs-list.h | 1 + 2 files changed, 39 insertions(+) diff

Re: [PATCH 10/10] Btrfs-progs: add show subcommand to subvol cli

2013-01-27 Thread Anand Jain
Stefan, Thanks for the review. if (sv_id == BTRFS_FS_TREE_OBJECTID) { oh yes. The common way to handle it is: static int cmd_subvol_show(int argc, char **argv) { int mntfd = -1; int fd = -1; char *mnt = NULL; char *fullpath = NULL; ...

Re: [PATCH 00/10 v3] add show sub-command for btrfs subvol cli

2013-01-27 Thread Anand Jain
sorry missed some git cli option and late noticed error in the change-log, Pls. ignore this thread and ref to the email thread with the subject: [RESEND] [PATCH 00/10 v3] add show sub-command for btrfs subvol cli -Anand On 01/28/2013 12:10 PM, Anand Jain wrote: Here is the v3

[PATCH 00/12 v4] add show sub-command for btrfs subvol cli

2013-01-28 Thread Anand Jain
Here is the v4 of this patch-set, kindly review and accept. v3-v4: . Included a patch from Wang Shilong . Added the changes to be inline with the above patch Anand Jain (11): Btrfs-progs: move open_file_or_dir() to utils.c Btrfs-progs: move printing subvol list outside

[PATCH 01/12] Btrfs-progs: move open_file_or_dir() to utils.c

2013-01-28 Thread Anand Jain
), the required XOPEN version was raised from 6 to 7. Signed-off-by: Anand Jain anand.j...@oracle.com Original-Signed-off-by: Stefan Behrens sbehr...@giantdisaster.de --- Makefile | 4 ++-- btrfsctl.c | 7 --- cmds-balance.c | 1 + cmds-inspect.c | 1 + cmds-qgroup.c| 1

[PATCH 02/12] Btrfs-progs: move printing subvol list outside of btrfs_list_subvols

2013-01-28 Thread Anand Jain
To improve the code reuse its better to have btrfs_list_subvols just return list of subvols witout printing Signed-off-by: Anand Jain anand.j...@oracle.com --- btrfs-list.c | 28 ++-- btrfs-list.h | 2 +- cmds-subvolume.c | 4 ++-- 3 files changed, 21 insertions

[PATCH 03/12] Btrfs-progs: add parent uuid for snapshots

2013-01-28 Thread Anand Jain
Signed-off-by: Anand Jain anand.j...@oracle.com --- btrfs-list.c | 34 -- btrfs-list.h | 1 + cmds-subvolume.c | 6 +- 3 files changed, 34 insertions(+), 7 deletions(-) diff --git a/btrfs-list.c b/btrfs-list.c index b404e1d..13a365d 100644

[PATCH 04/12] Btrfs-progs: move struct root_info to btrfs-list.h

2013-01-28 Thread Anand Jain
As we would add more ways to list and manage the subvols and snapshots, its better if we have struct root_info defined in the header file. Signed-off-by: Anand Jain anand.j...@oracle.com --- btrfs-list.c | 47 --- btrfs-list.h | 47

[PATCH 06/12] Btrfs-progs: add method to filter snapshots by parent uuid

2013-01-28 Thread Anand Jain
Signed-off-by: Anand Jain anand.j...@oracle.com --- btrfs-list.c | 6 ++ btrfs-list.h | 1 + 2 files changed, 7 insertions(+) diff --git a/btrfs-list.c b/btrfs-list.c index 0ee13b6..9c84ecb 100644 --- a/btrfs-list.c +++ b/btrfs-list.c @@ -1142,6 +1142,11 @@ static int filter_topid_equal

[PATCH 08/12] Btrfs-progs: make printing subvol extensible to newer layouts

2013-01-28 Thread Anand Jain
Currently you can print subvol in a list or table format. This patch will provide a way to extend this to other formats like the upcoming raw format. Signed-off-by: Anand Jain anand.j...@oracle.com --- btrfs-list.c | 26 +++--- btrfs-list.h | 3 +++ cmds-subvolume.c

[PATCH 07/12] Btrfs-progs: put find_mount_root() in commands.h

2013-01-28 Thread Anand Jain
A useful function need to define it in a header file. Signed-off-by: Anand Jain anand.j...@oracle.com --- commands.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/commands.h b/commands.h index 8114a73..9b77f3e 100644 --- a/commands.h +++ b/commands.h @@ -103,3 +103,6 @@ int cmd_qgroup

[PATCH 12/12] Btrfs-progs: update btrfs_get_subvol to be inline with resolve_root ret changes

2013-01-28 Thread Anand Jain
Signed-off-by: Anand Jain anand.j...@oracle.com --- btrfs-list.c | 11 --- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/btrfs-list.c b/btrfs-list.c index db3665c..0cc368c 100644 --- a/btrfs-list.c +++ b/btrfs-list.c @@ -1502,19 +1502,24 @@ int btrfs_list_subvols_print(int

[PATCH 09/12] Btrfs-progs: make get_subvol_name non cmds-send specific

2013-01-28 Thread Anand Jain
get_subvol_name can be used other than the just with in cmds-send.c so this patch will make it possible with out changing the original intentions. Signed-off-by: Anand Jain anand.j...@oracle.com --- cmds-send.c | 12 ++-- commands.h | 1 + 2 files changed, 7 insertions(+), 6 deletions

[PATCH 10/12] Btrfs-progs: add show subcommand to subvol cli

2013-01-28 Thread Anand Jain
This adds show sub-command to the btrfs subvol cli to display detailed inforamtion of the given subvol or snapshot. Signed-off-by: Anand Jain anand.j...@oracle.com --- btrfs-list.c | 25 +++-- btrfs-list.h | 3 +- cmds-subvolume.c | 155

[PATCH 11/12] Btrfs-progs: filter the deleted subvolumes when listing snapshots

2013-01-28 Thread Anand Jain
. If someone's -ref_tree or its parent's -ref_tree is 0, we will filter it. Reported-by: Stefan Priebe s.pri...@profihost.ag Signed-off-by: Wang Shilong wangsl-f...@cn.fujitsu.com Signed-off-by: Anand Jain anand.j...@oracle.com --- btrfs-list.c | 42 -- 1

Re: [PATCH 05/10] Btrfs-progs: add function btrfs_get_subvol to get root_info of a subvol

2013-01-28 Thread Anand Jain
here the code is correct, this base does not have [PATCH] Btrfs-progs: filter the deleted subvolumes when listing snapshots which introduced -ENOENT as a return for the resolve_root. however since we should have that. I have integrated, and made corresponding changes in the

[PATCH 00/12 v5] Btrfs-progs: add show sub-command for btrfs subvol cli

2013-01-30 Thread Anand Jain
David, Please find this patch-set rebased with your integration-20130130 branch. v4-v5: Fix a memory leak in the original code ref Patch 12/12 Fix the compiler warning in the patch 9/12 Anand Jain (11): Btrfs-progs: move printing subvol list outside of btrfs_list_subvols

[PATCH 01/12] Btrfs-progs: move printing subvol list outside of btrfs_list_subvols

2013-01-30 Thread Anand Jain
To improve the code reuse its better to have btrfs_list_subvols just return list of subvols witout printing Signed-off-by: Anand Jain anand.j...@oracle.com --- btrfs-list.c | 28 ++-- btrfs-list.h | 2 +- cmds-subvolume.c | 4 ++-- 3 files changed, 21 insertions

[PATCH 03/12] Btrfs-progs: move struct root_info to btrfs-list.h

2013-01-30 Thread Anand Jain
As we would add more ways to list and manage the subvols and snapshots, its better if we have struct root_info defined in the header file. Signed-off-by: Anand Jain anand.j...@oracle.com --- btrfs-list.c | 47 --- btrfs-list.h | 47

[PATCH 02/12] Btrfs-progs: add parent uuid for snapshots

2013-01-30 Thread Anand Jain
Signed-off-by: Anand Jain anand.j...@oracle.com --- btrfs-list.c | 34 -- btrfs-list.h | 1 + cmds-subvolume.c | 6 +- 3 files changed, 34 insertions(+), 7 deletions(-) diff --git a/btrfs-list.c b/btrfs-list.c index ab42a33..03a0d02 100644

[PATCH 05/12] Btrfs-progs: add method to filter snapshots by parent uuid

2013-01-30 Thread Anand Jain
Signed-off-by: Anand Jain anand.j...@oracle.com --- btrfs-list.c | 6 ++ btrfs-list.h | 1 + 2 files changed, 7 insertions(+) diff --git a/btrfs-list.c b/btrfs-list.c index 0e4b3eb..93d167e 100644 --- a/btrfs-list.c +++ b/btrfs-list.c @@ -1143,6 +1143,11 @@ static int filter_topid_equal

[PATCH 06/12] Btrfs-progs: put find_mount_root() in commands.h

2013-01-30 Thread Anand Jain
A useful function need to define it in a header file. Signed-off-by: Anand Jain anand.j...@oracle.com --- commands.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/commands.h b/commands.h index 61d74d7..1dd6180 100644 --- a/commands.h +++ b/commands.h @@ -105,3 +105,6 @@ int cmd_replace

[PATCH 07/12] Btrfs-progs: make printing subvol extensible to newer layouts

2013-01-30 Thread Anand Jain
Currently you can print subvol in a list or table format. This patch will provide a way to extend this to other formats like the upcoming raw format. Signed-off-by: Anand Jain anand.j...@oracle.com --- btrfs-list.c | 26 +++--- btrfs-list.h | 3 +++ cmds-subvolume.c

[PATCH 09/12] Btrfs-progs: add show subcommand to subvol cli

2013-01-30 Thread Anand Jain
This adds show sub-command to the btrfs subvol cli to display detailed inforamtion of the given subvol or snapshot. Signed-off-by: Anand Jain anand.j...@oracle.com --- btrfs-list.c | 25 +++-- btrfs-list.h | 3 +- cmds-subvolume.c | 155

[PATCH 11/12] Btrfs-progs: update btrfs_get_subvol to be inline with resolve_root ret changes

2013-01-30 Thread Anand Jain
Signed-off-by: Anand Jain anand.j...@oracle.com --- btrfs-list.c | 11 --- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/btrfs-list.c b/btrfs-list.c index 69ee3e7..eadfba4 100644 --- a/btrfs-list.c +++ b/btrfs-list.c @@ -1503,19 +1503,24 @@ int btrfs_list_subvols_print(int

[PATCH 10/12] Btrfs-progs: filter the deleted subvolumes when listing snapshots

2013-01-30 Thread Anand Jain
. If someone's -ref_tree or its parent's -ref_tree is 0, we will filter it. Reported-by: Stefan Priebe s.pri...@profihost.ag Signed-off-by: Wang Shilong wangsl-f...@cn.fujitsu.com Signed-off-by: Anand Jain anand.j...@oracle.com --- btrfs-list.c | 42 -- 1

[PATCH 12/12] Btrfs-progs: Fix a small memory leak in managing the btrfs list filter

2013-01-30 Thread Anand Jain
Signed-off-by: Anand Jain anand.j...@oracle.com --- cmds-subvolume.c | 57 +++- 1 file changed, 40 insertions(+), 17 deletions(-) diff --git a/cmds-subvolume.c b/cmds-subvolume.c index 9f1d2a4..5e51a26 100644 --- a/cmds-subvolume.c +++ b/cmds

[PATCH 08/12] Btrfs-progs: make get_subvol_name non cmds-send specific

2013-01-30 Thread Anand Jain
get_subvol_name can be used other than the just with in cmds-send.c so this patch will make it possible with out changing the original intentions. Signed-off-by: Anand Jain anand.j...@oracle.com --- cmds-send.c | 12 ++-- commands.h | 1 + 2 files changed, 7 insertions(+), 6 deletions

[PATCH 04/12] Btrfs-progs: add function btrfs_get_subvol to get root_info of a subvol

2013-01-30 Thread Anand Jain
We need a function which can get the root_info of a given subvol. This is in preparation to add support for the show sub-cli. Signed-off-by: Anand Jain anand.j...@oracle.com --- btrfs-list.c | 38 ++ btrfs-list.h | 1 + 2 files changed, 39 insertions(+) diff

Re: [PATCH 02/12] Btrfs-progs: move printing subvol list outside of btrfs_list_subvols

2013-01-30 Thread Anand Jain
Thanks for the review. Comments accepted. V5 sent out. Anand On 01/30/2013 11:27 AM, Wang Shilong wrote: Hi, To improve the code reuse its better to have btrfs_list_subvols just return list of subvols witout printing Signed-off-by: Anand Jain anand.j...@oracle.com --- btrfs-list.c

Re: [PATCH 10/12] Btrfs-progs: add show subcommand to subvol cli

2013-01-30 Thread Anand Jain
Wang, + ret = 0; + /* print the info */ I think it will be better if you can move the following printing to a function..it will make the code more clear and readable.. Thanks for looking into this. However IMO there is no need as of now. This can be taken when

[PATCH] Btrfs-progs: man btrfs: group subcommands together

2013-01-30 Thread Anand Jain
David, Kindly accept this patch for your Btrfs-progs integration-20130130 branch. This patch updates only man btrfs and is a very low risk category. Thanks, Anand Anand Jain (1): Btrfs-progs: man btrfs: subcommands must be grouped together man/btrfs.8.in | 12 ++-- 1 file

[PATCH] Btrfs-progs: man btrfs: subcommands must be grouped together

2013-01-30 Thread Anand Jain
Signed-off-by: Anand Jain anand.j...@oracle.com --- man/btrfs.8.in | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/man/btrfs.8.in b/man/btrfs.8.in index c8fdc15..8d3ecba 100644 --- a/man/btrfs.8.in +++ b/man/btrfs.8.in @@ -19,6 +19,8 @@ btrfs \- control a btrfs

[PATCH 00/13 v6] Btrfs-progs: add show sub-command for btrfs subvol cli

2013-01-31 Thread Anand Jain
David, Please find this v6 show patch-set for your integration-20130130 branch. v5-v6: added [PATCH 13/13] Btrfs-progs: add subvol flags to print Anand Jain (12): Btrfs-progs: move printing subvol list outside of btrfs_list_subvols Btrfs-progs: add parent uuid for snapshots

[PATCH 01/13] Btrfs-progs: move printing subvol list outside of btrfs_list_subvols

2013-01-31 Thread Anand Jain
To improve the code reuse its better to have btrfs_list_subvols just return list of subvols witout printing Signed-off-by: Anand Jain anand.j...@oracle.com --- btrfs-list.c | 28 ++-- btrfs-list.h | 2 +- cmds-subvolume.c | 4 ++-- 3 files changed, 21 insertions

[PATCH 02/13] Btrfs-progs: add parent uuid for snapshots

2013-01-31 Thread Anand Jain
Signed-off-by: Anand Jain anand.j...@oracle.com --- btrfs-list.c | 34 -- btrfs-list.h | 1 + cmds-subvolume.c | 6 +- 3 files changed, 34 insertions(+), 7 deletions(-) diff --git a/btrfs-list.c b/btrfs-list.c index ab42a33..03a0d02 100644

[PATCH 05/13] Btrfs-progs: add method to filter snapshots by parent uuid

2013-01-31 Thread Anand Jain
Signed-off-by: Anand Jain anand.j...@oracle.com --- btrfs-list.c | 6 ++ btrfs-list.h | 1 + 2 files changed, 7 insertions(+) diff --git a/btrfs-list.c b/btrfs-list.c index 0e4b3eb..93d167e 100644 --- a/btrfs-list.c +++ b/btrfs-list.c @@ -1143,6 +1143,11 @@ static int filter_topid_equal

[PATCH 06/13] Btrfs-progs: put find_mount_root() in commands.h

2013-01-31 Thread Anand Jain
A useful function need to define it in a header file. Signed-off-by: Anand Jain anand.j...@oracle.com --- commands.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/commands.h b/commands.h index 61d74d7..1dd6180 100644 --- a/commands.h +++ b/commands.h @@ -105,3 +105,6 @@ int cmd_replace

[PATCH 10/13] Btrfs-progs: filter the deleted subvolumes when listing snapshots

2013-01-31 Thread Anand Jain
. If someone's -ref_tree or its parent's -ref_tree is 0, we will filter it. Reported-by: Stefan Priebe s.pri...@profihost.ag Signed-off-by: Wang Shilong wangsl-f...@cn.fujitsu.com Signed-off-by: Anand Jain anand.j...@oracle.com --- btrfs-list.c | 42 -- 1

[PATCH 12/13] Btrfs-progs: Fix a small memory leak in managing the btrfs list filter

2013-01-31 Thread Anand Jain
Signed-off-by: Anand Jain anand.j...@oracle.com --- cmds-subvolume.c | 57 +++- 1 file changed, 40 insertions(+), 17 deletions(-) diff --git a/cmds-subvolume.c b/cmds-subvolume.c index 9f1d2a4..5e51a26 100644 --- a/cmds-subvolume.c +++ b/cmds

[PATCH 08/13] Btrfs-progs: make get_subvol_name non cmds-send specific

2013-01-31 Thread Anand Jain
get_subvol_name can be used other than the just with in cmds-send.c so this patch will make it possible with out changing the original intentions. Signed-off-by: Anand Jain anand.j...@oracle.com --- cmds-send.c | 12 ++-- commands.h | 1 + 2 files changed, 7 insertions(+), 6 deletions

[PATCH 07/13] Btrfs-progs: make printing subvol extensible to newer layouts

2013-01-31 Thread Anand Jain
Currently you can print subvol in a list or table format. This patch will provide a way to extend this to other formats like the upcoming raw format. Signed-off-by: Anand Jain anand.j...@oracle.com --- btrfs-list.c | 26 +++--- btrfs-list.h | 3 +++ cmds-subvolume.c

[PATCH 11/13] Btrfs-progs: update btrfs_get_subvol to be inline with resolve_root ret changes

2013-01-31 Thread Anand Jain
Signed-off-by: Anand Jain anand.j...@oracle.com --- btrfs-list.c | 11 --- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/btrfs-list.c b/btrfs-list.c index 69ee3e7..eadfba4 100644 --- a/btrfs-list.c +++ b/btrfs-list.c @@ -1503,19 +1503,24 @@ int btrfs_list_subvols_print(int

[PATCH 13/13] Btrfs-progs: add subvol flags to print

2013-01-31 Thread Anand Jain
This patch adds the flags row which as of now will show if the subvol/snapshot is readonly. Signed-off-by: Anand Jain anand.j...@oracle.com --- cmds-subvolume.c | 5 + 1 file changed, 5 insertions(+) diff --git a/cmds-subvolume.c b/cmds-subvolume.c index 5e51a26..c14e878 100644 --- a/cmds

[PATCH 04/13] Btrfs-progs: add function btrfs_get_subvol to get root_info of a subvol

2013-01-31 Thread Anand Jain
We need a function which can get the root_info of a given subvol. This is in preparation to add support for the show sub-cli. Signed-off-by: Anand Jain anand.j...@oracle.com --- btrfs-list.c | 38 ++ btrfs-list.h | 1 + 2 files changed, 39 insertions(+) diff

[PATCH 03/13] Btrfs-progs: move struct root_info to btrfs-list.h

2013-01-31 Thread Anand Jain
As we would add more ways to list and manage the subvols and snapshots, its better if we have struct root_info defined in the header file. Signed-off-by: Anand Jain anand.j...@oracle.com --- btrfs-list.c | 47 --- btrfs-list.h | 47

[PATCH] Btrfs-progs: add correct indentation

2013-02-21 Thread Anand Jain
A trivial fix, corrects the indentation. Signed-off-by: Anand Jain anand.j...@oracle.com --- utils.c | 13 +++-- 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/utils.c b/utils.c index d660507..9c2e510 100644 --- a/utils.c +++ b/utils.c @@ -1192,12 +1192,13 @@ scan_again

Re: Needed change in Wiki

2013-02-24 Thread Anand Jain
You may need to update the minimum version of libblkid-dev that is required. Since. latest btrfs-progs needs blkid_probe_get_wholedisk_devno() from the libblkid-dev. found libblkid-dev version 2.17.2 does not work, and 2.22 works. Not sure which version introduced the function required here.

[PATCH 0/2 v4] Btrfs-progs: Add support for subvol label

2013-02-24 Thread Anand Jain
-progs patch Btrfs-progs: add feature to label subvol and snapshot should be replaced with Btrfs-progs: add attribute label for subvol and snapshot (also posted in the mailing-list) and the above kernel patch should be removed. v4: rebased to David's integration-20130219 branch Anand Jain (2

[PATCH 1/2 v4] Btrfs-progs: add feature to label subvol and snapshot

2013-02-24 Thread Anand Jain
attribute label for subvol and snapshot) Signed-off-by: Anand Jain anand.j...@oracle.com --- btrfslabel.c | 45 + btrfslabel.h | 4 +++- ctree.h | 4 +++- ioctl.h | 2 ++ print-tree.c | 2 ++ 5 files changed, 55 insertions(+), 2 deletions

[PATCH 2/2 v4] Btrfs-progs: cmd option to show or set the subvol label

2013-02-24 Thread Anand Jain
This adds the command option label to the subvol sub-command, this is a generic patch which will stay irrespective of which approach we take, that is the ioctl-way or the attributes. Signed-off-by: Anand Jain anand.j...@oracle.com --- cmds-subvolume.c | 37

[PATCH v4] Btrfs: Add support for subvol label

2013-02-24 Thread Anand Jain
This is the btrfs kernel changes to add supprt for the subvol label. The related (v4) Btrfs-progs patches are Btrfs-progs: add feature to label subvol and snapshot Btrfs-progs: cmd option to show or set the subvol label v4: rebased to Josef Bacik btrfs-next Anand Jain (1): Btrfs

[PATCH v4] Btrfs: ability to add label to snapshot and subvol

2013-02-24 Thread Anand Jain
a consistent keyword across the applications is difficult in the long run. Signed-off-by: Anand Jain anand.j...@oracle.com --- fs/btrfs/ctree.h | 12 +- fs/btrfs/ioctl.c | 58 ++ fs/btrfs/transaction.c | 1 + include/uapi

Re: [PATCH] Btrfs-progs: add correct indentation

2013-02-27 Thread Anand Jain
On 02/27/2013 11:45 PM, David Sterba wrote: On Fri, Feb 22, 2013 at 02:59:24PM +0800, Anand Jain wrote: --- a/utils.c +++ b/utils.c @@ -1192,12 +1192,13 @@ scan_again: return -ENOENT; } /* skip the header */ - for(i=0; i 2 ; i

[PATCH] btrfs-progs: from troubleshooting point of view messages must be unique

2013-03-01 Thread Anand Jain
From the below, we won't readily know from where the error is generated - cmds-device.c: fprintf(stderr, ERROR: unable to scan the device '%s' - %s\n, utils.c:fprintf(stderr, ERROR: unable to scan the device '%s' - %s\n, - Signed-off-by: Anand Jain

[PATCH] btrfs-progs: usage should match what is coded

2013-03-01 Thread Anand Jain
Signed-off-by: Anand Jain anand.j...@oracle.com --- cmds-restore.c | 4 1 file changed, 4 deletions(-) diff --git a/cmds-restore.c b/cmds-restore.c index 9385042..4a14f93 100644 --- a/cmds-restore.c +++ b/cmds-restore.c @@ -763,10 +763,6 @@ const char * const cmd_restore_usage

[PATCH] btrfs-progs: traverse to backup super-block only when indicated

2013-03-01 Thread Anand Jain
This patch adds 4th parameter to btrfs_scan_one_device() which when set to non-zero value will traverse to check backup super-block. Signed-off-by: Anand Jain anand.j...@oracle.com --- btrfs-show.c | 2 +- btrfsctl.c| 2 +- cmds-device.c | 4 ++-- cmds-filesystem.c | 4

Re: [bug] mkfs.btrfs reports device busy for ext4 mounted disk

2013-03-01 Thread Anand Jain
btrfs-progs shouldn't be unconditionally trusting the backup superblocks if the primary is garbage. It should only check the backups if the user specifically asks it to. Agreed. Let me add that all the rescue tools should accept a parameter to pick the backup superblocks. Currently fsck -s,

Re: [PATCH v4] Btrfs: ability to add label to snapshot and subvol

2013-03-01 Thread Anand Jain
As long as we integrate, broadcast and use single keyword for a purpose I am fine with using xattr. Patch using xattr was posted as well. Just a note, potential applications using snapshot label are: - Yum, btrfs-progs, snapper, btrfs-gui, Gnome-Nautilus-snapshot-plugin,

Re: [PATCH] btrfs-progs: traverse to backup super-block only when indicated

2013-03-03 Thread Anand Jain
flags = BTRFS_SCAN_REGISTER | BTRFS_SCAN_PRIMARY_SB; btrfs_scan_one_dir(/dev/, flags) I just got too flexed into the current way of coding in btrfs-progs :-) But let me get at least this part of the code in the right-way. Thanks Eric for pointing out. -Anand -- To unsubscribe from

Re: mkfs.btrfs broken

2013-03-07 Thread Anand Jain
On 03/07/2013 08:11 PM, Swâmi Petaramesh wrote: Hi, mkfs.btrfs v0.20-rc1, as provided in the excellent Parted Magic tool, latest version dated 2013/02/28, is broken : When trying to mkfs.btrfs - even on newly made, FS-free partition, it always spits an error that it cannot check partition

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

2013-03-08 Thread Anand Jain
: Accepts Eric and Zach review. Seprates 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-progs: use

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

2013-03-08 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 --- btrfsctl.c| 2 +- cmds-device.c | 4 ++-- disk-io.c | 3 ++- find-root.c | 3 ++- utils.c

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

2013-03-08 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 3/3] btrfs-progs: use BTRFS_SCAN_BACKUP_SB flag in btrfs_scan_one_device

2013-03-08 Thread Anand Jain
btrfs_scan_for_fsid(). To ensure rest of the logic is unaffected, this patch will ensure BTRFS_SCAN_BACKUP_SB is set for all other places except at check_mounted_where(). Signed-off-by: Anand Jain anand.j...@oracle.com --- cmds-device.c | 3 ++- cmds-filesystem.c | 2 +- cmds-replace.c| 3

[PATCH] btrfs-progs: update the .gitignore file

2013-03-08 Thread Anand Jain
Signed-off-by: Anand Jain anand.j...@oracle.com --- .gitignore | 10 ++ 1 file changed, 10 insertions(+) diff --git a/.gitignore b/.gitignore index 230dfbd..a32b96c 100644 --- a/.gitignore +++ b/.gitignore @@ -15,3 +15,13 @@ find-root mkfs.btrfs repair restore +btrfs-convert +btrfs

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

2013-03-13 Thread Anand Jain
-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-progs

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

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

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

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

[PATCH] btrfs-progs: update .gitignore file

2013-03-13 Thread Anand Jain
Signed-off-by: Anand Jain anand.j...@oracle.com --- .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

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

2013-03-13 Thread Anand Jain
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 run_ioctl btrfs

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

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

2013-03-13 Thread Anand Jain
Signed-off-by: Anand Jain anand.j...@oracle.com --- 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

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

2013-03-13 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] 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 anand.j...@oracle.com --- utils.c | 3 ++- 1 file

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

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

2013-03-14 Thread Anand Jain
/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 works awesome

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: maybe a little more commit log would be good? 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

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 body

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

2013-03-15 Thread Anand Jain
maybe a little more commit log would be good? 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

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

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-mounted

[PATCH] btrfs-progs: return zero for success

2013-03-18 Thread Anand Jain
Signed-off-by: Anand Jain anand.j...@oracle.com --- 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

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

2013-03-18 Thread Anand Jain
Signed-off-by: Anand Jain anand.j...@oracle.com --- 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

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

2013-03-21 Thread Anand Jain
with 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 anand.j...@oracle.com --- cmds-device.c | 53 +++-- utils.c | 31 --- 2 files

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

[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:

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

2013-03-27 Thread Anand Jain
Signed-off-by: Anand Jain anand.j...@oracle.com --- 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

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

2013-03-27 Thread Anand Jain
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_scan_one_device btrfs

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

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

2013-03-27 Thread Anand Jain
with 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 anand.j...@oracle.com --- cmds-device.c | 53 +++-- utils.c | 31 --- 2 files

[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 anand.j...@oracle.com --- disk-io.c | 2 +- find-root.c | 2 +- utils.c | 2 +- volumes.c | 2 +- 4 files changed, 4 insertions

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

2013-03-27 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 3/5 v5] btrfs-progs: Introduce flag BTRFS_SCAN_BACKUP_SB for btrfs_read_dev_super

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

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

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