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.
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)
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,
/* 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);