From: nathan Date: Wed, 6 Apr 2005 01:55:27 +0000 (+0000) Subject: Branch b1_4 X-Git-Tag: v1_8_0_110~486^7~53 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=f6b8a1781deaa2fbdfcf71c1658299972bf91f51;p=fs%2Flustre-release.git Branch b1_4 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. --- diff --git a/lustre/mds/handler.c b/lustre/mds/handler.c index bdb1e83..06832c2 100644 --- a/lustre/mds/handler.c +++ b/lustre/mds/handler.c @@ -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) diff --git a/lustre/obdfilter/filter.c b/lustre/obdfilter/filter.c index 56056a7..9ede6b2 100644 --- a/lustre/obdfilter/filter.c +++ b/lustre/obdfilter/filter.c @@ -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);