linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/4] btrfs-progs: Avoid interpreting options after "--" when getting unit mode
@ 2016-03-14  0:02 Satoru Takeuchi
  2016-03-14  0:12 ` [PATCH 2/4] btrfs-progs: fix a reression that "property" with -t option doesn't work Satoru Takeuchi
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Satoru Takeuchi @ 2016-03-14  0:02 UTC (permalink / raw)
  To: linux-btrfs@vger.kernel.org

* actual result

  ======================================
  # ./btrfs device usage -- -m /btrfs

  /dev/sdf1, ID: 1
     Device size:          95367.41MiB
     Data,single:          2056.00MiB
     Metadata,DUP:         2048.00MiB
     System,DUP:             16.00MiB
     Unallocated:          91247.41MiB
  ======================================

* expected result

  ======================================
  # ./btrfs device usage -- -m /btrfs

  ERROR: can't access '-m': No such file or directory
  ======================================

Signed-off-by: Satoru Takeuchi <takeuchi_satoru@jp.fujitsu.com>
---
This patch can be applied to devel branch (commit: 31266d0ef811).
---
 utils.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/utils.c b/utils.c
index d7ceaa8..77f0f68 100644
--- a/utils.c
+++ b/utils.c
@@ -3024,6 +3024,9 @@ unsigned int get_unit_mode_from_arg(int *argc, char *argv[], int df_mode)
 	int arg_end;

 	for (arg_i = 0; arg_i < *argc; arg_i++) {
+		if (!strcmp(argv[arg_i], "--"))
+			break;
+
 		if (!strcmp(argv[arg_i], "--raw")) {
 			unit_mode = UNITS_RAW;
 			argv[arg_i] = NULL;
-- 
2.7.0

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

end of thread, other threads:[~2016-04-25 11:59 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-14  0:02 [PATCH 1/4] btrfs-progs: Avoid interpreting options after "--" when getting unit mode Satoru Takeuchi
2016-03-14  0:12 ` [PATCH 2/4] btrfs-progs: fix a reression that "property" with -t option doesn't work Satoru Takeuchi
2016-03-14 12:23   ` David Sterba
2016-03-15 23:28     ` Satoru Takeuchi
2016-03-14  0:15 ` [PATCH 3/4] btrfs-progs: Fix a regression that btrfs filesystem label " Satoru Takeuchi
2016-03-14 12:19   ` David Sterba
2016-03-14  0:27 ` [PATCH 4/4] btrfs-progs: "device ready" accepts just one device Satoru Takeuchi
2016-03-14 12:05   ` David Sterba
2016-04-25 11:59     ` David Sterba
2016-03-14 12:28 ` [PATCH 1/4] btrfs-progs: Avoid interpreting options after "--" when getting unit mode 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).