From 40e4f1c63655a8630763de0302847a578ef4ff6b Mon Sep 17 00:00:00 2001 From: tianzy Date: Wed, 21 Jan 2009 02:56:42 +0000 Subject: [PATCH] Branch HEAD take refcount of export when quotacheck is going on b=18126 i=shadow i=panda --- lustre/quota/quota_check.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lustre/quota/quota_check.c b/lustre/quota/quota_check.c index 62fc1f0..25344e3 100644 --- a/lustre/quota/quota_check.c +++ b/lustre/quota/quota_check.c @@ -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); -- 1.8.3.1