Uploaded image for project: 'Lustre'
  1. Lustre
  2. LU-1185 FID on OST
  3. LU-2681

need to handle lsr_flags having other flags set

    XMLWordPrintable

Details

    • Technical task
    • Resolution: Fixed
    • Blocker
    • Lustre 2.4.0
    • Lustre 2.4.0
    • 6268

    Description

      The "lsr_flags" field is currently treated as if it only held LU_SEQ_RANGE_MDT or LU_SEQ_RANGE_OST values. These cannot purely be treated as flags, since LU_SEQ_RANGE_MDT = 0 for compatibility reasons.

      If the lsr_flags field ever gets other flags in the future, then checks using "==" instead of "&" will fail, for example:

      lustre/osd-zfs/osd_oi.c:266

             if (range->lsr_flags == LU_SEQ_RANGE_OST)
      

      A similar "==" check is made in fld_server_lookup().

      Probably an LU_SEQ_RANGE_TYPE = 1 mask should be created, and then helper function can be created to check the type:

      unsigned fld_range_type(struct lu_seq_range *range)
      {
               return range->lsr_flags & LU_SEQ_RANGE_TYPE;
      }
      

      and it can be used like:

              if (fld_range_type(range) == LU_SEQ_RANGE_OST)
      or
              if (fld_range_type(range) == LU_SEQ_RANGE_MDT)
      or
              if (fld_range_type(erange) == fld_range_type(range))
      

      Attachments

        Activity

          People

            di.wang Di Wang
            adilger Andreas Dilger
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: