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

"lctl set_param jobid_var" should return error about missing value

    XMLWordPrintable

Details

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

    Description

      lctl set_param jobid_var should return an error and print an error message about a missing value, but instead it is just ignored.

      [root@centclient05 LU-7437-test]# lctl get_param jobid_var
      jobid_var=disable
      [root@centclient05 LU-7437-test]# lctl set_param jobid_var
      [root@centclient05 LU-7437-test]# echo $?
      0
      [root@centclient05 LU-7437-test]# lctl get_param jobid_var
      jobid_var=disable
      

      Note, however, that if the jobid_var has a trailing =, it behaves differently, despite meaning the same thing.

      [root@centclient05 LU-7437-test]# lctl set_param jobid_var=
      error: set_param: setting jobid_var: no value
      [root@centclient05 LU-7437-test]# echo $?
      22
      

      Any trailing argument of the "set_param" without a corresponding value is ignored. E.g. the following variations also fail to print an error message when they should because jobid_var does not have a value:

      lctl set_param ldlm.namespaces.*.lru_size=clear jobid_var
      lctl set_param ldlm.namespaces.*.lru_size clear jobid_var
      lctl set_param ldlm.namespaces.*osc*.lru_size=clear ldlm.namespaces.*mdc*.lru_size=clear jobid_var
      

      However, if jobid_var contains a trailing '=', all of these examples print an error message and return a non-zero status.

      In addition, this behavior is inconsistent and should be fixed:

      [root@centclient05 LU-7437-test]# lctl set_param jobid_var=foo=bar
      jobid_var=foo=bar
      [root@centclient05 LU-7437-test]# lctl get_param jobid_var
      jobid_var=foo=bar
      [root@centclient05 LU-7437-test]# lctl set_param jobid_var foo=bar
      error: set_param: setting jobid_var=foo=bar: bad value
      [root@centclient05 LU-7437-test]# echo $?
      22
      [root@centclient05 LU-7437-test]# lctl get_param jobid_var
      jobid_var=foo=bar
      

      The two different lctl set_param commands above should mean the same thing. IMO, lctl set_param should accept values which contain the = character because there is no intrinsic constraint against writing a = to the corresponding procfs/sysfs/debugfs file.

      Attachments

        Issue Links

          Activity

            People

              emoly.liu Emoly Liu
              haasken Ryan Haasken
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: