diff mbox

[3/5] btrfs-progs: "inspect-internal subvolid-resolve" doesn't work

Message ID 56EB5A74.6000908@jp.fujitsu.com (mailing list archive)
State Accepted
Headers show

Commit Message

Satoru Takeuchi March 18, 2016, 1:31 a.m. UTC
"inspect-internal subvolid-resolve" doesn't work from the following commit.

commit 176aeca9a148 ("btrfs-progs: add getopt stubs where needed")

It's because 1st argument, subvolid, is also used for the pathname of
filesystem. 2nd argument should be used for this purpose instead.

* actual result

   ==================================================
   # ./btrfs inspect-internal subvolid-resolve 260 /btrfs
   ERROR: cannot access '260': No such file or directory
   ==================================================

* expected result

   ==================================================
   # btrfs inspect-internal subvolid-resolve 260 /btrfs
   snap
   ==================================================

Signed-off-by: Satoru Takeuchi <takeuchi_satoru@jp.fujitsu.com>
---
  cmds-inspect.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox

Patch

diff --git a/cmds-inspect.c b/cmds-inspect.c
index 04e1ae8..6045985 100644
--- a/cmds-inspect.c
+++ b/cmds-inspect.c
@@ -273,7 +273,7 @@  static int cmd_inspect_subvolid_resolve(int argc, char **argv)
  	if (check_argc_exact(argc - optind, 2))
  		usage(cmd_inspect_subvolid_resolve_usage);

-	fd = btrfs_open_dir(argv[optind], &dirstream, 1);
+	fd = btrfs_open_dir(argv[optind + 1], &dirstream, 1);
  	if (fd < 0) {
  		ret = -ENOENT;
  		goto out;