Uploaded image for project: 'Lustre'
  1. Lustre
  2. LU-8621

Parser_execarg() prints help to stderr, usage to stdout

Details

    • Bug
    • Resolution: Fixed
    • Minor
    • Lustre 2.16.0
    • None
    • 3
    • 9223372036854775807

    Description

      When running lfs CMD --help or lctl CMD --help the help message is printed to stderr. By convention stdout should be used instead.

      When using lfs or lctl, if an unrecognized command is passed to Parser_execarg() we get a 100+ line usage message printed to stdout.

      # lctl barf
      Try interactive use without arguments or use one of:
      "===== metacommands ======="
      "--device"
      "--ignore_errors"
      "ignore_errors"
      "======== control ========="
      "help"
      "lustre_build_version"
      "exit"
      "quit"
      ...
      "llog_print"
      "llog_check"
      "llog_cancel"
      "llog_remove"
      "add_interface"
      "del_interface"
      "add_route"
      "del_route"
      "set_route"
      as argument.
      
      1. We shouldn't spam the terminal with so many lines of output for an unrecognized command.
      2. We need to print the command that was passed.
        # git barf
        git: 'barf' is not a git command. See 'git --help'.
        
        Did you mean this?
        	branch
        

      Attachments

        Issue Links

          Activity

            [LU-8621] Parser_execarg() prints help to stderr, usage to stdout
            bzzz Alex Zhuravlev added a comment - - edited

            somehow this patch breaks sanity-quota/8:

            Throughput 4.31965 MB/sec 3 clients 3 procs max_latency=152.458 ms
            sanity-quota test_8: @@@@@@ FAIL: test_8 failed with 1
            Trace dump:
            = ./../tests/test-framework.sh:6522:error()
            = ./../tests/test-framework.sh:6858:run_one()
            = ./../tests/test-framework.sh:6905:run_one_logged()
            = ./../tests/test-framework.sh:6730:run_test()
            = sanity-quota.sh:2299:main()
            Dumping lctl log to /tmp/ltest-logs/sanity-quota.test_8.*.1657617064.log
            Dumping logs only on local client.
            Delete files...
            Wait for unlink objects finished...
            Waiting for MDT destroys to complete
            test_8 returned 1
            FAIL 8 (182s)

            bisection result:

            COMMIT		TESTED	PASSED	FAILED		COMMIT DESCRIPTION
            210803a247	1	0	1	BAD	LU-15653 client: able to cleanup devices manually
            a21ce928aa	1	0	1	BAD	LU-15894 ofd: revert range locking in ofd
            b2dfb4457f	1	0	1	BAD	LU-15759 libcfs: debugfs file_operation should have an owner
            98ba508190	1	0	1	BAD	LU-15779 ofd: don't hold read lock over bulk
            0396310692	1	0	1	BAD	LU-15727 lod: honor append_pool with default composite layouts
            71d63602c5	1	0	1	BAD	LU-15922 sec: new connect flag for name encryption
            4a2498d22f	1	0	1	BAD	LU-15952 doc: improvement on lfs-project doc
            9bf968db56	1	0	1	BAD	LU-15942 utils: ofd_access_log_reader exit status
            e3a4dc406f	1	0	1	BAD	LU-15931 tests: Escape * in log()
            bc69a8d058	1	0	1	BAD	LU-8621 utils: cmd help to stdout or short cmd error
            6ab060e58e	4	4	0		LU-14555 lnet: asym route inconsistency warning
            6bceb0030d	4	4	0		LU-13335 ldiskfs: add projid to debug logs
            aa22a6826e	4	4	0		LU-15481 llog: Add LLOG_SKIP_PLAIN to skip llog plain
            
            bzzz Alex Zhuravlev added a comment - - edited somehow this patch breaks sanity-quota/8: Throughput 4.31965 MB/sec 3 clients 3 procs max_latency=152.458 ms sanity-quota test_8: @@@@@@ FAIL: test_8 failed with 1 Trace dump: = ./../tests/test-framework.sh:6522:error() = ./../tests/test-framework.sh:6858:run_one() = ./../tests/test-framework.sh:6905:run_one_logged() = ./../tests/test-framework.sh:6730:run_test() = sanity-quota.sh:2299:main() Dumping lctl log to /tmp/ltest-logs/sanity-quota.test_8.*.1657617064.log Dumping logs only on local client. Delete files... Wait for unlink objects finished... Waiting for MDT destroys to complete test_8 returned 1 FAIL 8 (182s) bisection result: COMMIT TESTED PASSED FAILED COMMIT DESCRIPTION 210803a247 1 0 1 BAD LU-15653 client: able to cleanup devices manually a21ce928aa 1 0 1 BAD LU-15894 ofd: revert range locking in ofd b2dfb4457f 1 0 1 BAD LU-15759 libcfs: debugfs file_operation should have an owner 98ba508190 1 0 1 BAD LU-15779 ofd: don't hold read lock over bulk 0396310692 1 0 1 BAD LU-15727 lod: honor append_pool with default composite layouts 71d63602c5 1 0 1 BAD LU-15922 sec: new connect flag for name encryption 4a2498d22f 1 0 1 BAD LU-15952 doc: improvement on lfs-project doc 9bf968db56 1 0 1 BAD LU-15942 utils: ofd_access_log_reader exit status e3a4dc406f 1 0 1 BAD LU-15931 tests: Escape * in log() bc69a8d058 1 0 1 BAD LU-8621 utils: cmd help to stdout or short cmd error 6ab060e58e 4 4 0 LU-14555 lnet: asym route inconsistency warning 6bceb0030d 4 4 0 LU-13335 ldiskfs: add projid to debug logs aa22a6826e 4 4 0 LU-15481 llog: Add LLOG_SKIP_PLAIN to skip llog plain
            pjones Peter Jones added a comment -

            Landed for 2.16

            pjones Peter Jones added a comment - Landed for 2.16

            "Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/47162/
            Subject: LU-8621 utils: cmd help to stdout or short cmd error
            Project: fs/lustre-release
            Branch: master
            Current Patch Set:
            Commit: bc69a8d058f5bcdb75e062df57a6ccd23243d1e0

            gerrit Gerrit Updater added a comment - "Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/47162/ Subject: LU-8621 utils: cmd help to stdout or short cmd error Project: fs/lustre-release Branch: master Current Patch Set: Commit: bc69a8d058f5bcdb75e062df57a6ccd23243d1e0

            "Andreas Dilger <adilger@whamcloud.com>" uploaded a new patch: https://review.whamcloud.com/47162
            Subject: LU-8621 utils: cmd help to stdout or short cmd error
            Project: fs/lustre-release
            Branch: master
            Current Patch Set: 1
            Commit: ab80394f9bb2a49c61f14499843c974a1db7aece

            gerrit Gerrit Updater added a comment - "Andreas Dilger <adilger@whamcloud.com>" uploaded a new patch: https://review.whamcloud.com/47162 Subject: LU-8621 utils: cmd help to stdout or short cmd error Project: fs/lustre-release Branch: master Current Patch Set: 1 Commit: ab80394f9bb2a49c61f14499843c974a1db7aece

            People

              aalyaev Aleksei Alyaev (Inactive)
              jhammond John Hammond
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: