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

incorrect integer format string used for short type

Details

    • Bug
    • Resolution: Fixed
    • Trivial
    • Lustre 2.8.0
    • Lustre 2.7.0
    • None
    • Build on Ubuntu 15.04, static analysis check build with current cppcheck
    • 4
    • 9223372036854775807

    Description

      cppcheck found an incorrect format string being used for a short type:

      Checking lustre/quota/lquota_entry.c...
      [lustre/quota/lquota_entry.c:219]: (warning) %u in format string (no. 1) requires 'unsigned int' but the argument type is 'short'.

      struct lquota_site *lquota_site_alloc(const struct lu_env *env, void *parent,
      bool is_master, short qtype,
      struct lquota_entry_operations *ops)
      ...

      sprintf(hashname, "LQUOTA_HASH%u", qtype);

      needs to be %hu (or %hd)

      Attachments

        Activity

          [LU-6539] incorrect integer format string used for short type
          pjones Peter Jones added a comment -

          Landed for 2.8

          pjones Peter Jones added a comment - Landed for 2.8

          Oleg Drokin (oleg.drokin@intel.com) merged in patch http://review.whamcloud.com/14810/
          Subject: LU-6539 quota: fix incorrect format string used for short type
          Project: fs/lustre-release
          Branch: master
          Current Patch Set:
          Commit: a001ce6f192f2bb284980d3bfcf94f9df1d15ca6

          gerrit Gerrit Updater added a comment - Oleg Drokin (oleg.drokin@intel.com) merged in patch http://review.whamcloud.com/14810/ Subject: LU-6539 quota: fix incorrect format string used for short type Project: fs/lustre-release Branch: master Current Patch Set: Commit: a001ce6f192f2bb284980d3bfcf94f9df1d15ca6

          Dmitry Eremin (dmitry.eremin@intel.com) uploaded a new patch: http://review.whamcloud.com/14814
          Subject: LU-6539 utils: fix potential memory leaks with realloc()
          Project: fs/lustre-release
          Branch: master
          Current Patch Set: 1
          Commit: f8596ecbfe0e75e211da9591956fce3a41dda41b

          gerrit Gerrit Updater added a comment - Dmitry Eremin (dmitry.eremin@intel.com) uploaded a new patch: http://review.whamcloud.com/14814 Subject: LU-6539 utils: fix potential memory leaks with realloc() Project: fs/lustre-release Branch: master Current Patch Set: 1 Commit: f8596ecbfe0e75e211da9591956fce3a41dda41b

          Dmitry Eremin (dmitry.eremin@intel.com) uploaded a new patch: http://review.whamcloud.com/14810
          Subject: LU-6539 quota: fix incorrect format string used for short type
          Project: fs/lustre-release
          Branch: master
          Current Patch Set: 1
          Commit: 1037ef83d2547b90cd6578065b648524cdfac21b

          gerrit Gerrit Updater added a comment - Dmitry Eremin (dmitry.eremin@intel.com) uploaded a new patch: http://review.whamcloud.com/14810 Subject: LU-6539 quota: fix incorrect format string used for short type Project: fs/lustre-release Branch: master Current Patch Set: 1 Commit: 1037ef83d2547b90cd6578065b648524cdfac21b

          People

            dmiter Dmitry Eremin (Inactive)
            colinianking Colin Ian King
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: