Whamcloud - gitweb
Avoid leaking dentries and mfds
authorshadow <shadow>
Fri, 26 Jun 2009 11:13:49 +0000 (11:13 +0000)
committershadow <shadow>
Fri, 26 Jun 2009 11:13:49 +0000 (11:13 +0000)
Branch b_release_1_8_1
b=19756
o=green
i=shadow
i=adilger

lustre/mds/mds_open.c

index 517a301..0c5a565 100644 (file)
@@ -587,6 +587,7 @@ static void reconstruct_open(struct mds_update_record *rec, int offset,
                 }
 
                 dchild = mds_lookup(obd, rec->ur_name, parent, rec->ur_namelen - 1);
+                l_dput(parent);
                 if (IS_ERR(dchild)) {
                         rc = PTR_ERR(dchild);
                         LCONSOLE_WARN("Child "LPU64"/%u lookup error %d."
@@ -595,7 +596,6 @@ static void reconstruct_open(struct mds_update_record *rec, int offset,
                                       rc, obd_uuid2str(&exp->exp_client_uuid),
                                       obd_export_nid2str(exp));
                         mds_export_evict(exp);
-                        l_dput(parent);
                         EXIT;
                         return;
                 }
@@ -1592,10 +1592,10 @@ out:
         /* If other clients have this file open for write, rc will be > 0 */
         if (rc > 0)
                 rc = 0;
-        l_dput(mfd->mfd_dentry);
-        mds_mfd_put(mfd);
 
  cleanup:
+        l_dput(mfd->mfd_dentry);
+        mds_mfd_put(mfd);
         if (req != NULL && reply_body != NULL) {
                 rc = mds_finish_transno(mds, NULL, handle, req, rc, 0, 0);
         } else if (handle) {