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

object leak in mdt_open_by_fid_lock()

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: Lustre 2.6.0
    • Fix Version/s: Lustre 2.6.0
    • Labels:
    • Severity:
      3
    • Rank (Obsolete):
      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

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: