Whamcloud - gitweb
Branch HEAD
authortianzy <tianzy>
Wed, 21 Jan 2009 02:56:42 +0000 (02:56 +0000)
committertianzy <tianzy>
Wed, 21 Jan 2009 02:56:42 +0000 (02:56 +0000)
take refcount of export when quotacheck is going on
b=18126
i=shadow
i=panda

lustre/quota/quota_check.c

index 62fc1f0..25344e3 100644 (file)
@@ -114,6 +114,7 @@ static int target_quotacheck_thread(void *data)
         pop_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
 
         rc = target_quotacheck_callback(exp, oqctl);
+        class_export_put(exp);
 
         atomic_inc(qta->qta_sem);
 
@@ -155,6 +156,9 @@ int target_quota_check(struct obd_device *obd, struct obd_export *exp,
                 }
         }
 
+        /* we get ref for exp because target_quotacheck_callback() will use this
+         * export later b=18126 */
+        class_export_get(exp);
         rc = kernel_thread(target_quotacheck_thread, qta, CLONE_VM|CLONE_FILES);
         if (rc >= 0) {
                 CDEBUG(D_INFO, "%s: target_quotacheck_thread: %d\n",
@@ -162,6 +166,7 @@ int target_quota_check(struct obd_device *obd, struct obd_export *exp,
                 RETURN(0);
         }
 
+        class_export_put(exp);
         CERROR("%s: error starting quotacheck_thread: %d\n",
                obd->obd_name, rc);
         OBD_FREE_PTR(qta);