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

Suspect locking cleanup issue in mdt_create()

Details

    • Bug
    • Resolution: Not a Bug
    • Minor
    • Lustre 2.11.0
    • None
    • None
    • 3
    • 9223372036854775807

    Description

      In mdt_create():

                              if (!mdt_object_remote(parent)) {
                                      mdt_object_unlock(info, parent, lh, 1);
                                      mdt_lock_pdo_init(lh, LCK_PW, &rr->rr_name);
                                      rc = mdt_reint_object_lock(info, parent, lh,
                                                                 MDS_INODELOCK_UPDATE,
                                                                 true);
                                      if (rc)
                                              GOTO(put_child, rc);
                              }
      ...
      put_child:
              mdt_object_put(info->mti_env, child);
      unlock_parent:
              mdt_object_unlock(info, parent, lh, rc);
      put_parent:
              mdt_object_put(info->mti_env, parent);
              RETURN(rc);
      

      So if we cannot lock parent we jump to put child and then unlock parent? that sounds wrong.

      Attachments

        Activity

          [LU-7874] Suspect locking cleanup issue in mdt_create()
          laisiyao Lai Siyao added a comment -

          this is not a bug IMO, mdt_object_unlock() is safe to call multiple times, because it will clear lock handle after unlock, so this GOTO is to make sure child is put, and it's written this way to simplify failure cleanup.

          laisiyao Lai Siyao added a comment - this is not a bug IMO, mdt_object_unlock() is safe to call multiple times, because it will clear lock handle after unlock, so this GOTO is to make sure child is put, and it's written this way to simplify failure cleanup.
          pjones Peter Jones added a comment -

          Lai

          Can you please look into this?

          Peter

          pjones Peter Jones added a comment - Lai Can you please look into this? Peter

          People

            laisiyao Lai Siyao
            green Oleg Drokin
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: