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

lfs changelog fails for MDT index containing numerals [A-F]

Details

    • Bug
    • Resolution: Fixed
    • Major
    • Lustre 2.10.1, Lustre 2.11.0
    • Lustre 2.8.0
    • lustre-2.8.0_8.chaos
    • 3
    • 9223372036854775807

    Description

      lfs changelog <mdtname>
      

      parses the index of mdtname incorrectly, causing it to fetch the wrong changelog entries if the index contains letters [A-F] (e.g. lquake-MDT000A).

      The error appears to be here:

      diff --git a/lustre/utils/liblustreapi.c b/lustre/utils/liblustreapi.c
      index 9301383..38e2085 100644
      --- a/lustre/utils/liblustreapi.c
      +++ b/lustre/utils/liblustreapi.c
      @@ -3985,7 +3985,7 @@ int root_ioctl(const char *mdtname, int opc, void *data, int *mdtidxp,
                               return -EINVAL;
                       ptr = fsname + strlen(fsname) - 8;
                       *ptr = '\0';
      -                index = strtol(ptr + 4, NULL, 10);
      +                index = strtol(ptr + 4, NULL, 16);
                       rc = get_root_path(WANT_FD | want_error, fsname, &fd, NULL, -1);
               }
               if (rc < 0) {
      

      It looks like this error is present in Lustre 2.9 as well. Master exposes changelogs using the MDT name itself, not just the index, and may not have this issue.

      Attachments

        Activity

          [LU-9505] lfs changelog fails for MDT index containing numerals [A-F]

          John L. Hammond (john.hammond@intel.com) merged in patch https://review.whamcloud.com/28225/
          Subject: LU-9505 llapi: treat MDT index as a hex number
          Project: fs/lustre-release
          Branch: b2_10
          Current Patch Set:
          Commit: f75574c5f6d88eb697dfafce11469b4e3f2b8e95

          gerrit Gerrit Updater added a comment - John L. Hammond (john.hammond@intel.com) merged in patch https://review.whamcloud.com/28225/ Subject: LU-9505 llapi: treat MDT index as a hex number Project: fs/lustre-release Branch: b2_10 Current Patch Set: Commit: f75574c5f6d88eb697dfafce11469b4e3f2b8e95

          Minh Diep (minh.diep@intel.com) uploaded a new patch: https://review.whamcloud.com/28225
          Subject: LU-9505 llapi: treat MDT index as a hex number
          Project: fs/lustre-release
          Branch: b2_10
          Current Patch Set: 1
          Commit: 7a96bf2b64166a2050fa0d3d2a52ee517b712f44

          gerrit Gerrit Updater added a comment - Minh Diep (minh.diep@intel.com) uploaded a new patch: https://review.whamcloud.com/28225 Subject: LU-9505 llapi: treat MDT index as a hex number Project: fs/lustre-release Branch: b2_10 Current Patch Set: 1 Commit: 7a96bf2b64166a2050fa0d3d2a52ee517b712f44
          pjones Peter Jones added a comment -

          Landed for 2.11

          pjones Peter Jones added a comment - Landed for 2.11

          Oleg Drokin (oleg.drokin@intel.com) merged in patch https://review.whamcloud.com/27156/
          Subject: LU-9505 llapi: treat MDT index as a hex number
          Project: fs/lustre-release
          Branch: master
          Current Patch Set:
          Commit: 26b710a536dc58c9fa0320cdbf5f6b7ce4dc1a68

          gerrit Gerrit Updater added a comment - Oleg Drokin (oleg.drokin@intel.com) merged in patch https://review.whamcloud.com/27156/ Subject: LU-9505 llapi: treat MDT index as a hex number Project: fs/lustre-release Branch: master Current Patch Set: Commit: 26b710a536dc58c9fa0320cdbf5f6b7ce4dc1a68

          Emoly Liu (emoly.liu@intel.com) uploaded a new patch: https://review.whamcloud.com/27156
          Subject: LU-9505 llapi: treat MDT index as a hex number
          Project: fs/lustre-release
          Branch: master
          Current Patch Set: 1
          Commit: 6aa457bd3f8557812e7b6b67d20709075e7f3beb

          gerrit Gerrit Updater added a comment - Emoly Liu (emoly.liu@intel.com) uploaded a new patch: https://review.whamcloud.com/27156 Subject: LU-9505 llapi: treat MDT index as a hex number Project: fs/lustre-release Branch: master Current Patch Set: 1 Commit: 6aa457bd3f8557812e7b6b67d20709075e7f3beb
          pjones Peter Jones added a comment -

          Emoly

          Could you please assist with this issue. Even though this function is not called in master it would be a good idea to either correct or remove the function there to prevent someone getting hit by this problem again (as well as providing a suitable fix for LLNL on 2.8 FE)

          Peter

          pjones Peter Jones added a comment - Emoly Could you please assist with this issue. Even though this function is not called in master it would be a good idea to either correct or remove the function there to prevent someone getting hit by this problem again (as well as providing a suitable fix for LLNL on 2.8 FE) Peter

          People

            emoly.liu Emoly Liu
            ofaaland Olaf Faaland
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: