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

"lctl nodemap_add" argument checking is poor

    XMLWordPrintable

Details

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

    Description

      I was trying to create a new nodemap and used the command:

      # lctl nodemap_add nodemap.1
      error: invalid ioctl: 000ce040 errno: 22: Invalid argument
      nodemap_add: Invalid argument
      

      This returned a rather vague "invalid argument" error, but didn't say what was wrong with the command. I tried several other variants without success:

      # lctl nodemap_add --name nodemap.1
      error: invalid ioctl: 000ce040 errno: 22: Invalid argument
      nodemap_add: Invalid argument
      # lctl nodemap_add --help
      error: invalid ioctl: 000ce040 errno: 22: Invalid argument
      nodemap_add: Invalid argument
      # lctl nodemap_add --name nodemap1
      error: invalid ioctl: 000ce040 errno: 22: Invalid argument
      

      The correct command format is:

      # lctl help nodemap_add 
      nodemap_add: add a new nodemap
      usage: nodemap_add <nodemap_name>
      

      Firstly, it would be good if the usage message was printed if the command fails.

      Secondly, it would be good to print a useful error message other than just "invalid argument", like "lctl nodemap_add: error: nodemap name can only contain alphanumeric characters, '-' and '_'" (or whatever the naming rules are).

      Thirdly, it probably makes sense to special case nodemap names like "--name|-n" (since this is used for all of the other nodemap commands), and "--help|-h" (since this is a standard argument that users expect to actually give them some helpful information).

      These changes should be reflected in the lustre/doc/lctl-nodemap_add.8 man page.

      Attachments

        Activity

          People

            wc-triage WC Triage
            adilger Andreas Dilger
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: