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

unstable code in lov_unpackmd

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Minor
    • Lustre 2.6.0
    • Lustre 2.6.0
    • None
    • 3
    • 11327

    Description

      Playing with the stack tool for detecting unstable code (http://css.csail.mit.edu/stack/) I uncovered this gem:

              if (*lsmp && !lmm) {
                      lov_free_memmd(lsmp);
                      RETURN(0);
              }
      
              pattern = le32_to_cpu(lmm->lmm_pattern); <<-- *dereferencing lmm*
              lsm_size = lov_alloc_memmd(lsmp, stripe_count, pattern, magic);
              if (lsm_size < 0)
                      RETURN(lsm_size);
      
              /* If we are passed a pointer but nothing to unpack, we only alloc */
              if (!lmm) <<--  *Now we make sure it's not NULL?*
                      RETURN(lsm_size);
      

      After further looking, it appears that the lmm is never passed in as NULL, which ould allow us the opportunity to further simplify this I guess.

      Attachments

        Issue Links

          Activity

            People

              wc-triage WC Triage
              green Oleg Drokin
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: