Whamcloud - gitweb
Branch b1_4
authornathan <nathan>
Wed, 6 Apr 2005 01:55:27 +0000 (01:55 +0000)
committernathan <nathan>
Wed, 6 Apr 2005 01:55:27 +0000 (01:55 +0000)
b=5949
The end of mds_connect was a mess.  In an error case, it dropped too many
export refs.  I think this might be the cause of 5949, 6030, 6058

Same commit, different rev. I jumped the gun on undoing this.

lustre/mds/handler.c
lustre/obdfilter/filter.c

index bdb1e83..06832c2 100644 (file)
@@ -296,16 +296,19 @@ static int mds_connect(struct lustre_handle *conn, struct obd_device *obd,
         med->med_mcd = mcd;
 
         rc = mds_client_add(obd, &obd->u.mds, med, -1);
-        if (rc == 0)
-                EXIT;
+
 out:
         if (rc) {
-                OBD_FREE(mcd, sizeof(*mcd));
+                if (mcd) {
+                        OBD_FREE(mcd, sizeof(*mcd));
+                        med->med_mcd = NULL;
+                }
                 class_disconnect(exp);
+        } else {
+                class_export_put(exp);
         }
-        class_export_put(exp);
 
-        return rc;
+        RETURN(rc);
 }
 
 static int mds_init_export(struct obd_export *exp) 
index 56056a7..9ede6b2 100644 (file)
@@ -1467,13 +1467,16 @@ static int filter_connect(struct lustre_handle *conn, struct obd_device *obd,
 
 cleanup:
         if (rc) {
-                if (fcd)
+                if (fcd) {
                         OBD_FREE(fcd, sizeof(*fcd));
+                        fed->fed_fcd = NULL;
+                }
                 class_disconnect(exp);
         } else {
                 class_export_put(exp);
         }
-        return rc;
+        
+        RETURN(rc);
 }
 
 /* Do extra sanity checks for grant accounting.  We do this at connect,
@@ -1621,7 +1624,6 @@ static int filter_disconnect(struct obd_export *exp)
 
         /* Disconnect early so that clients can't keep using export */
         rc = class_disconnect(exp);
-
         ldlm_cancel_locks_for_export(exp);
 
         fsfilt_sync(obd, obd->u.filter.fo_sb);