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

Mount options parsing problem

    XMLWordPrintable

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

            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: