Details

    • Bug
    • Resolution: Fixed
    • Major
    • Lustre 2.10.0
    • Lustre 2.8.0
    • 3
    • 9223372036854775807

    Description

      The code which parse the mount option (lustre/utils/mount_lustre.c: parse_ldd()) expect that the default mount options come first and then the user given options. But actually the default options are appended after the user given option. Because of this user given options are cleared.

      Following code fix this bug:

      diff --git a/lustre/utils/mount_lustre.c b/lustre/utils/mount_lustre.c
      index e4cc51a..44d092c 100644
      --- a/lustre/utils/mount_lustre.c
      +++ b/lustre/utils/mount_lustre.c
      @@ -385,6 +385,7 @@ static int parse_ldd(char *source, struct mount_opts *mop, char *options)
       {
              struct lustre_disk_data *ldd = &mop->mo_ldd;
              char *cur, *start;
      +       char *temp_options;
              int rc;
       
              rc = osd_is_lustre(source, &ldd->ldd_mount_type);
      @@ -438,12 +439,21 @@ static int parse_ldd(char *source, struct mount_opts *mop, char *options)
                              ldd->ldd_flags |= LDD_F_WRITECONF;
                      }
              }
      +
      +       /* This is to make sure default options go first */
      +       temp_options = strdup(options);
      +       if (temp_options == NULL) {
      +               fprintf(stderr, "can't allocate memory for temp_options\n");
      +               return ENOMEM;
      +       }
      +       strcpy(options, ldd->ldd_mount_opts);
      +       append_option(options, temp_options);
      +       free(temp_options);
      +
              /* backend osd type */
              append_option(options, "osd=");
              strcat(options, mt_type(ldd->ldd_mount_type));
       
      -       append_option(options, ldd->ldd_mount_opts);
      -
              if (!mop->mo_have_mgsnid) {
                      /* Only use disk data if mount -o mgsnode=nid wasn't
                       * specified */
      
      

      Attachments

        Issue Links

          Activity

            [LU-6952] Mount options parsing problem
            pjones Peter Jones added a comment -

            Landed for 2.10

            pjones Peter Jones added a comment - Landed for 2.10

            Oleg Drokin (oleg.drokin@intel.com) merged in patch https://review.whamcloud.com/15906/
            Subject: LU-6952 mount: Mount options parsing problem
            Project: fs/lustre-release
            Branch: master
            Current Patch Set:
            Commit: b27652cb440f2bea59db254e955403484c6c1d3a

            gerrit Gerrit Updater added a comment - Oleg Drokin (oleg.drokin@intel.com) merged in patch https://review.whamcloud.com/15906/ Subject: LU-6952 mount: Mount options parsing problem Project: fs/lustre-release Branch: master Current Patch Set: Commit: b27652cb440f2bea59db254e955403484c6c1d3a
            hongchao.zhang Hongchao Zhang added a comment - - edited
            hongchao.zhang Hongchao Zhang added a comment - - edited http://review.whamcloud.com/15906 has been updated

            the patch http://review.whamcloud.com/15870 in LU-6992 can't resolve this problem, and I have refreshed the patch.

            hongchao.zhang Hongchao Zhang added a comment - the patch http://review.whamcloud.com/15870 in LU-6992 can't resolve this problem, and I have refreshed the patch.

            Can you please check if http://review.whamcloud.com/15870 will also resolve this problem?

            adilger Andreas Dilger added a comment - Can you please check if http://review.whamcloud.com/15870 will also resolve this problem?

            pratik.shinde (pratik.shinde@seagate.com) uploaded a new patch: http://review.whamcloud.com/15906
            Subject: LU-6952 mount: Mount options parsing problem
            Project: fs/lustre-release
            Branch: master
            Current Patch Set: 1
            Commit: 0ebfd4c44c427628fd4928328582ad329c347c84

            gerrit Gerrit Updater added a comment - pratik.shinde (pratik.shinde@seagate.com) uploaded a new patch: http://review.whamcloud.com/15906 Subject: LU-6952 mount: Mount options parsing problem Project: fs/lustre-release Branch: master Current Patch Set: 1 Commit: 0ebfd4c44c427628fd4928328582ad329c347c84

            Hongchao,
            This looks similar to your patch, can you look at it?
            Thanks.
            Joe

            jgmitter Joseph Gmitter (Inactive) added a comment - Hongchao, This looks similar to your patch, can you look at it? Thanks. Joe

            It looks like the LU-6662 bug is very similar.

            adilger Andreas Dilger added a comment - It looks like the LU-6662 bug is very similar.

            Apology for any confusion. There is no perticular reason for this. Will post the patch to gerrit.

            520557 Rahul Deshmukh (Inactive) added a comment - Apology for any confusion. There is no perticular reason for this. Will post the patch to gerrit.

            Is there a reason why you posted the patch as a comment here instead of pushing a patch to Gerrit?

            adilger Andreas Dilger added a comment - Is there a reason why you posted the patch as a comment here instead of pushing a patch to Gerrit?

            People

              hongchao.zhang Hongchao Zhang
              520557 Rahul Deshmukh (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              12 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: