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

object leak in mdt_open_by_fid_lock()

Details

    • Bug
    • Resolution: Fixed
    • Blocker
    • Lustre 2.6.0
    • Lustre 2.6.0
    • 3
    • 14371

    Description

      In mdt_open_by_fid_lock() parent may be leaked if the second call to mdt_object_find() fails.

      int mdt_open_by_fid_lock(struct mdt_thread_info *info, struct ldlm_reply *rep,
                               struct mdt_lock_handle *lhc)
      {
              const struct lu_env     *env   = info->mti_env;
              struct mdt_device       *mdt   = info->mti_mdt;
              __u64                    flags = info->mti_spec.sp_cr_flags;
              struct mdt_reint_record *rr    = &info->mti_rr;
              struct md_attr          *ma    = &info->mti_attr;
              struct mdt_object       *parent= NULL;
              struct mdt_object       *o;
              int                      rc;
              __u64                    ibits = 0;
              ENTRY;
      
              if (md_should_create(flags) && !(flags & MDS_OPEN_HAS_EA)) {
                      if (!lu_fid_eq(rr->rr_fid1, rr->rr_fid2)) {
                              parent = mdt_object_find(env, mdt, rr->rr_fid1);
                              if (IS_ERR(parent)) {
                                      CDEBUG(D_INODE, "Fail to find parent "DFID
                                             " for anonymous created %ld, try to"
                                             " use server-side parent.\n",
                                             PFID(rr->rr_fid1), PTR_ERR(parent));
                                      parent = NULL;
                              }
                      }
                      if (parent == NULL)
                              ma->ma_need |= MA_PFID;
              }
      
              o = mdt_object_find(env, mdt, rr->rr_fid2);
              if (IS_ERR(o))
                      RETURN(rc = PTR_ERR(o));
      

      Attachments

        Issue Links

          Activity

            [LU-5177] object leak in mdt_open_by_fid_lock()
            jlevi Jodi Levi (Inactive) made changes -
            Resolution New: Fixed [ 1 ]
            Status Original: In Progress [ 3 ] New: Resolved [ 5 ]
            tappro Mikhail Pershin made changes -
            Status Original: Open [ 1 ] New: In Progress [ 3 ]
            adilger Andreas Dilger made changes -
            Link New: This issue is related to LU-3544 [ LU-3544 ]
            jlevi Jodi Levi (Inactive) made changes -
            Assignee Original: WC Triage [ wc-triage ] New: Mikhail Pershin [ tappro ]
            jlevi Jodi Levi (Inactive) made changes -
            Priority Original: Minor [ 4 ] New: Blocker [ 1 ]
            jlevi Jodi Levi (Inactive) made changes -
            Fix Version/s New: Lustre 2.6.0 [ 10595 ]
            jhammond John Hammond made changes -
            Link New: This issue is related to LU-5178 [ LU-5178 ]
            jhammond John Hammond created issue -

            People

              tappro Mikhail Pershin
              jhammond John Hammond
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: