Whamcloud - gitweb
LU-7707 quota: put qqi reference after all things done 42/18142/2
authorNiu Yawei <yawei.niu@intel.com>
Tue, 26 Jan 2016 02:52:43 +0000 (21:52 -0500)
committerOleg Drokin <oleg.drokin@intel.com>
Wed, 23 Mar 2016 06:03:17 +0000 (06:03 +0000)
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 <yawei.niu@intel.com>
Change-Id: I363efd8be22a6ea5b9589c6b152bf924e1f1abae
Reviewed-on: http://review.whamcloud.com/18142
Tested-by: Jenkins
Reviewed-by: Fan Yong <fan.yong@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Bobi Jam <bobijam@hotmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/quota/qsd_reint.c

index 5263c52..70d9b8b 100644 (file)
@@ -532,11 +532,12 @@ out:
        qqi->qqi_reint = 0;
        write_unlock(&qsd->qsd_lock);
 
        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);
        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;
 }
 
        return rc;
 }