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

mdt_hsm_release() clobbers ma_valid

Details

    • Bug
    • Resolution: Duplicate
    • Minor
    • None
    • Lustre 2.5.0
    • 3
    • 9871

    Description

      In mdt_hsm_release() we have:

              ma->ma_need = MA_HSM | MA_LOV;
              rc = mdt_attr_get_complex(info, o, ma);
              if (rc != 0)
                      GOTO(out_unlock, rc);
      
              ...
      
              ma->ma_valid = MA_INODE;
              ma->ma_attr.la_valid &= LA_SIZE | LA_MTIME | LA_ATIME;
              rc = mo_attr_set(info->mti_env, mdt_object_child(o), ma);
              if (rc < 0)
                      GOTO(out_unlock, rc);
      
              if (!(ma->ma_valid & MA_LOV)) {
                      /* Even empty file are released */
                      memset(ma->ma_lmm, 0, sizeof(*ma->ma_lmm));
                      ma->ma_lmm->lmm_magic = cpu_to_le32(LOV_MAGIC_V1_DEF);
                      ma->ma_lmm->lmm_pattern = cpu_to_le32(LOV_PATTERN_RAID0);
      		ma->ma_lmm->lmm_stripe_size = cpu_to_le32(LOV_MIN_STRIPE_SIZE);
                      ma->ma_valid |= MA_LOV;
              } else {
                      /* Magic must be LOV_MAGIC_Vx_DEF otherwise LOD will interpret            
                       * ma_lmm as lov_user_md, then it will be confused by union of            
                       * layout_gen and stripe_offset. */
                      if (le32_to_cpu(ma->ma_lmm->lmm_magic) == LOV_MAGIC_V1)
                              ma->ma_lmm->lmm_magic = cpu_to_le32(LOV_MAGIC_V1_DEF);
      		else if (le32_to_cpu(ma->ma_lmm->lmm_magic) == LOV_MAGIC_V3)
                              ma->ma_lmm->lmm_magic = cpu_to_le32(LOV_MAGIC_V3_DEF);
                      else
                              GOTO(out_unlock, rc = -EINVAL);
              }
      

      Attachments

        Issue Links

          Activity

            [LU-3825] mdt_hsm_release() clobbers ma_valid
            jlevi Jodi Levi (Inactive) made changes -
            Fix Version/s Original: Lustre 2.5.0 [ 10295 ]
            Resolution New: Duplicate [ 3 ]
            Status Original: Reopened [ 4 ] New: Closed [ 6 ]
            jlevi Jodi Levi (Inactive) made changes -
            Resolution Original: Fixed [ 1 ]
            Status Original: Resolved [ 5 ] New: Reopened [ 4 ]
            jlevi Jodi Levi (Inactive) made changes -
            Link New: This issue is duplicated by LU-3811 [ LU-3811 ]
            jlevi Jodi Levi (Inactive) made changes -
            Fix Version/s New: Lustre 2.5.0 [ 10295 ]
            jlevi Jodi Levi (Inactive) made changes -
            Resolution New: Fixed [ 1 ]
            Status Original: In Progress [ 3 ] New: Resolved [ 5 ]

            Patch has landed to Master.

            jlevi Jodi Levi (Inactive) added a comment - Patch has landed to Master.

            Yes.

            jhammond John Hammond added a comment - Yes.

            7461 is for another ticket. Do you confirm you merge the 2 tickets?

            jcl jacques-charles lafoucriere added a comment - 7461 is for another ticket. Do you confirm you merge the 2 tickets?
            jhammond John Hammond made changes -
            Status Original: Open [ 1 ] New: In Progress [ 3 ]
            jhammond John Hammond made changes -
            Assignee Original: WC Triage [ wc-triage ] New: John Hammond [ jhammond ]

            People

              jhammond John Hammond
              jhammond John Hammond
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: