From 6fc9046a6a595eef80780ae2c1739cbd67ca827f Mon Sep 17 00:00:00 2001 From: Niu Yawei Date: Mon, 25 Jan 2016 21:52:43 -0500 Subject: [PATCH] LU-7707 quota: put qqi reference after all things done In qsd_reint_main(), we should put qqi reference when all things done, otherwise, the qqi could be used after free in some race condition. Signed-off-by: Niu Yawei Change-Id: I363efd8be22a6ea5b9589c6b152bf924e1f1abae Reviewed-on: http://review.whamcloud.com/18142 Tested-by: Jenkins Reviewed-by: Fan Yong Tested-by: Maloo Reviewed-by: Bobi Jam Reviewed-by: Oleg Drokin --- lustre/quota/qsd_reint.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lustre/quota/qsd_reint.c b/lustre/quota/qsd_reint.c index 5263c52..70d9b8b 100644 --- a/lustre/quota/qsd_reint.c +++ b/lustre/quota/qsd_reint.c @@ -532,11 +532,12 @@ out: qqi->qqi_reint = 0; write_unlock(&qsd->qsd_lock); - qqi_putref(qqi); - lu_ref_del(&qqi->qqi_reference, "reint_thread", thread); - thread_set_flags(thread, SVC_STOPPED); wake_up(&thread->t_ctl_waitq); + + lu_ref_del(&qqi->qqi_reference, "reint_thread", thread); + qqi_putref(qqi); + return rc; } -- 1.8.3.1