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

mdt_rec_reint template is not consistent

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Minor
    • Lustre 2.16.0
    • Lustre 2.16.0
    • 3
    • 9223372036854775807

    Description

      The struct mdt_rec_reint should be the template for all struct mdt_rec_* instances. However, the introduction of the "__u16 rr_mirror_id" field added to the end of only mdt_rec_resync and mdt_rec_reint breaks this pattern, and risks future data corruption in mixed-endian environments if the __u32 padding field at the end of other mdt_rec_* fields is used as a __u32 instead, because there is only a single swabbing function for all of these records.

      There are two possible solutions to this issue:

      • change the last __u32 padding field of all other struct mdt_rec_* to a pai of __u16 padding fields. This is technically less complex to implement. However, this prevents their use as a __u32 in the future.
      • move the mirror_id usage to a different __u32 field in struct mdt_rec_reint along with a new required OBD_CONNECT_MIRROR_ID_FIX interoperability check. The struct mdt_rec_reint has lots of other spare fields and using a __u32 to store a 16-bit value is fine. This is more complex to implement and will require some time for transition (the field was originally added in commit v2_11_56_0-70-g14171e787dd0, so would need interoperability for some time. However, this field is only used in one place, so the compat support is isolated and would liberate this field for use by the nanosecond timestamp code in LU-1158, or some other future usage (which is important since it is te last common reserved field in all structs).

      Attachments

        Issue Links

          Activity

            People

              adilger Andreas Dilger
              adilger Andreas Dilger
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: