linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] btrfs-progs: fix option handling for some commands
@ 2017-08-24  5:18 Misono, Tomohiro
  2017-08-24  5:24 ` [PATCH 2/3] " Misono, Tomohiro
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Misono, Tomohiro @ 2017-08-24  5:18 UTC (permalink / raw)
  To: linux-btrfs

I found some btrfs commands options are not working because of 
inappropriate getopt_long() setting.

This fixes "btrfs check -Q/-E"

Signed-off-by: Tomohiro Misono <misono.tomohiro@jp.fujitsu.com>
---
  cmds-check.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cmds-check.c b/cmds-check.c
index c5faa2b..465fd17 100644
--- a/cmds-check.c
+++ b/cmds-check.c
@@ -12745,7 +12745,7 @@ int cmd_check(int argc, char **argv)
  			{ NULL, 0, NULL, 0}
  		};

-		c = getopt_long(argc, argv, "as:br:p", long_options, NULL);
+		c = getopt_long(argc, argv, "as:br:pQE:", long_options, NULL);
  		if (c < 0)
  			break;
  		switch(c) {
-- 
2.9.4


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/3] btrfs-progs: fix option handling for some commands
  2017-08-24  5:18 [PATCH 1/3] btrfs-progs: fix option handling for some commands Misono, Tomohiro
@ 2017-08-24  5:24 ` Misono, Tomohiro
  2017-08-24  5:25 ` [PATCH 3/3] " Misono, Tomohiro
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Misono, Tomohiro @ 2017-08-24  5:24 UTC (permalink / raw)
  To: linux-btrfs

This fixes "btrfs receive -E"

Signed-off-by: Tomohiro Misono <misono.tomohiro@jp.fujitsu.com>
---
  cmds-receive.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cmds-receive.c b/cmds-receive.c
index 72e9c8f..e584cef 100644
--- a/cmds-receive.c
+++ b/cmds-receive.c
@@ -1277,7 +1277,7 @@ int cmd_receive(int argc, char **argv)
  			{ NULL, 0, NULL, 0 }
  		};

-		c = getopt_long(argc, argv, "Cevf:m:", long_opts, NULL);
+		c = getopt_long(argc, argv, "Cevf:m:E:", long_opts, NULL);
  		if (c < 0)
  			break;

-- 
2.9.4


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 3/3] btrfs-progs: fix option handling for some commands
  2017-08-24  5:18 [PATCH 1/3] btrfs-progs: fix option handling for some commands Misono, Tomohiro
  2017-08-24  5:24 ` [PATCH 2/3] " Misono, Tomohiro
@ 2017-08-24  5:25 ` Misono, Tomohiro
  2017-08-24  6:06 ` [PATCH] btrfs-progs: change document in accordance with usage info Misono, Tomohiro
  2017-08-24 17:18 ` [PATCH 1/3] btrfs-progs: fix option handling for some commands David Sterba
  3 siblings, 0 replies; 5+ messages in thread
From: Misono, Tomohiro @ 2017-08-24  5:25 UTC (permalink / raw)
  To: linux-btrfs

This fixes "btrfs inspect-internal dump-super --bytenr"

Signed-off-by: Tomohiro Misono <misono.tomohiro@jp.fujitsu.com>
---
  cmds-inspect-dump-super.c | 7 +++++++
  1 file changed, 7 insertions(+)

diff --git a/cmds-inspect-dump-super.c b/cmds-inspect-dump-super.c
index 98e0270..c7afd80 100644
--- a/cmds-inspect-dump-super.c
+++ b/cmds-inspect-dump-super.c
@@ -519,11 +519,13 @@ int cmd_inspect_dump_super(int argc, char **argv)

  	while (1) {
  		int c;
+		enum { GETOPT_VAL_BYTENR = 257 };
  		static const struct option long_options[] = {
  			{"all", no_argument, NULL, 'a'},
  			{"full", no_argument, NULL, 'f'},
  			{"force", no_argument, NULL, 'F'},
  			{"super", required_argument, NULL, 's' },
+			{"bytenr", required_argument, NULL, GETOPT_VAL_BYTENR },
  			{NULL, 0, NULL, 0}
  		};

@@ -565,6 +567,11 @@ int cmd_inspect_dump_super(int argc, char **argv)
  			}
  			all = 0;
  			break;
+		case GETOPT_VAL_BYTENR:
+			arg = arg_strtou64(optarg);
+			sb_bytenr = arg;
+			all = 0;
+			break;
  		default:
  			usage(cmd_inspect_dump_super_usage);
  		}
-- 
2.9.4


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH] btrfs-progs: change document in accordance with usage info
  2017-08-24  5:18 [PATCH 1/3] btrfs-progs: fix option handling for some commands Misono, Tomohiro
  2017-08-24  5:24 ` [PATCH 2/3] " Misono, Tomohiro
  2017-08-24  5:25 ` [PATCH 3/3] " Misono, Tomohiro
@ 2017-08-24  6:06 ` Misono, Tomohiro
  2017-08-24 17:18 ` [PATCH 1/3] btrfs-progs: fix option handling for some commands David Sterba
  3 siblings, 0 replies; 5+ messages in thread
From: Misono, Tomohiro @ 2017-08-24  6:06 UTC (permalink / raw)
  To: linux-btrfs

Usage info of "btrfs check" shows "-Q|--qgroup-report" (and first patch 
enables -Q), but the document only shows "--qgroup-report".

Therefore add -Q to the doc.

Signed-off-by: Tomohiro Misono <misono.tomohiro@jp.fujitsu.com>
---
  Documentation/btrfs-check.asciidoc | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Documentation/btrfs-check.asciidoc 
b/Documentation/btrfs-check.asciidoc
index 28ed9dd..fa054e4 100644
--- a/Documentation/btrfs-check.asciidoc
+++ b/Documentation/btrfs-check.asciidoc
@@ -60,7 +60,7 @@ show extent state for the given subvolume
  -p|--progress::
  indicate progress at various checking phases

---qgroup-report::
+-Q|--qgroup-report::
  verify qgroup accounting and compare against filesystem accounting

  -r|--tree-root <bytenr>::
--
2.9.5


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/3] btrfs-progs: fix option handling for some commands
  2017-08-24  5:18 [PATCH 1/3] btrfs-progs: fix option handling for some commands Misono, Tomohiro
                   ` (2 preceding siblings ...)
  2017-08-24  6:06 ` [PATCH] btrfs-progs: change document in accordance with usage info Misono, Tomohiro
@ 2017-08-24 17:18 ` David Sterba
  3 siblings, 0 replies; 5+ messages in thread
From: David Sterba @ 2017-08-24 17:18 UTC (permalink / raw)
  To: Misono, Tomohiro; +Cc: linux-btrfs

On Thu, Aug 24, 2017 at 02:18:25PM +0900, Misono, Tomohiro wrote:
> I found some btrfs commands options are not working because of 
> inappropriate getopt_long() setting.
> 
> This fixes "btrfs check -Q/-E"
> 
> Signed-off-by: Tomohiro Misono <misono.tomohiro@jp.fujitsu.com>

Patches 1-3 and the doc fix applied with some changelog updates, thanks.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-08-24 17:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-24  5:18 [PATCH 1/3] btrfs-progs: fix option handling for some commands Misono, Tomohiro
2017-08-24  5:24 ` [PATCH 2/3] " Misono, Tomohiro
2017-08-24  5:25 ` [PATCH 3/3] " Misono, Tomohiro
2017-08-24  6:06 ` [PATCH] btrfs-progs: change document in accordance with usage info Misono, Tomohiro
2017-08-24 17:18 ` [PATCH 1/3] btrfs-progs: fix option handling for some commands David Sterba

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).