Whamcloud - gitweb
Branch HEAD
authortappro <tappro>
Thu, 29 Oct 2009 12:07:24 +0000 (12:07 +0000)
committertappro <tappro>
Thu, 29 Oct 2009 12:07:24 +0000 (12:07 +0000)
b=20802
i=adilger
i=alex

take export reference for transaction callback during client addition

lustre/ldlm/ldlm_lib.c
lustre/mdt/mdt_recovery.c
lustre/obdfilter/filter.c

index 334ee8b..ec88bed 100644 (file)
@@ -637,8 +637,10 @@ void target_client_add_cb(struct obd_device *obd, __u64 transno, void *cb_data,
         spin_lock(&exp->exp_lock);
         exp->exp_need_sync = 0;
         spin_unlock(&exp->exp_lock);
+        class_export_cb_put(exp);
 }
 EXPORT_SYMBOL(target_client_add_cb);
+
 static void
 target_start_and_reset_recovery_timer(struct obd_device *obd,
                                       struct ptlrpc_request *req,
index 449241b..7fc6064 100644 (file)
@@ -576,7 +576,7 @@ int mdt_client_new(const struct lu_env *env, struct mdt_device *mdt)
          * transaction so that many connecting clients will not bring
          * server down with lots of sync writes.
          */
-        mdt_trans_add_cb(th, lut_cb_client, mti->mti_exp);
+        mdt_trans_add_cb(th, lut_cb_client, class_export_cb_get(mti->mti_exp));
         spin_lock(&mti->mti_exp->exp_lock);
         mti->mti_exp->exp_need_sync = 1;
         spin_unlock(&mti->mti_exp->exp_lock);
@@ -690,8 +690,9 @@ int mdt_client_del(const struct lu_env *env, struct mdt_device *mdt)
                 LBUG();
         }
 
-        /* write server data at first so last_transno will be save in it in
-         * any case */
+        /* Make sure the server's last_transno is up to date.
+         * This should be done before zeroing client slot so last_transno will
+         * be in server data or in client data in case of failure */
         mdt_server_data_update(env, mdt);
 
         mdt_trans_credit_init(env, mdt, MDT_TXN_LAST_RCVD_WRITE_OP);
index e159b7b..4f665be 100644 (file)
@@ -362,7 +362,8 @@ static int filter_client_add(struct obd_device *obd, struct obd_export *exp,
                                               filter->fo_fsd->lsd_start_epoch;
                         exp->exp_last_request_time = cfs_time_current_sec();
                         rc = fsfilt_add_journal_cb(obd, 0, handle,
-                                                   target_client_add_cb, exp);
+                                                   target_client_add_cb,
+                                                   class_export_cb_get(exp));
                         if (rc == 0) {
                                 spin_lock(&exp->exp_lock);
                                 exp->exp_need_sync = 1;