Whamcloud - gitweb
LU-3334 quota: use different names for reint threads 41/6341/5
authorNiu Yawei <yawei.niu@intel.com>
Wed, 15 May 2013 03:32:17 +0000 (23:32 -0400)
committerOleg Drokin <oleg.drokin@intel.com>
Wed, 10 Jul 2013 02:50:22 +0000 (02:50 +0000)
Use different thread names for the quota reint threads.

Signed-off-by: Niu Yawei <yawei.niu@intel.com>
Change-Id: I54a4d074106e6f0fa9a21a0fd91a9096c54035f4
Reviewed-on: http://review.whamcloud.com/6341
Tested-by: Hudson
Reviewed-by: Johann Lombardi <johann.lombardi@intel.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
lustre/quota/qsd_reint.c

index 15fc40f..59e3877 100644 (file)
@@ -509,7 +509,7 @@ static int qsd_reint_main(void *args)
                qsd_bump_version(qqi, qqi->qqi_slv_ver, false);
        }
 
-       /* wait for the connection to master established */
+       /* wait for the qsd instance started (target recovery done) */
        l_wait_event(thread->t_ctl_waitq,
                     qsd_started(qsd) || !thread_is_running(thread), &lwi);
 
@@ -626,15 +626,16 @@ int qsd_start_reint_thread(struct qsd_qtype_info *qqi)
 {
        struct ptlrpc_thread    *thread = &qqi->qqi_reint_thread;
        struct qsd_instance     *qsd = qqi->qqi_qsd;
-       struct l_wait_info      lwi = { 0 };
-       int                     rc;
+       struct l_wait_info       lwi = { 0 };
+       int                      rc;
+       char                    *name;
        ENTRY;
 
        /* don't bother to do reintegration when quota isn't enabled */
-       if (!qsd_type_enabled(qqi->qqi_qsd, qqi->qqi_qtype))
+       if (!qsd_type_enabled(qsd, qqi->qqi_qtype))
                RETURN(0);
 
-       if (qqi->qqi_qsd->qsd_acct_failed)
+       if (qsd->qsd_acct_failed)
                /* no space accounting support, can't enable enforcement */
                RETURN(0);
 
@@ -660,7 +661,16 @@ int qsd_start_reint_thread(struct qsd_qtype_info *qqi)
                RETURN(0);
        }
 
-       rc = PTR_ERR(kthread_run(qsd_reint_main, (void *)qqi, "qsd_reint"));
+       OBD_ALLOC(name, MTI_NAME_MAXLEN);
+       if (name == NULL)
+               RETURN(-ENOMEM);
+
+       snprintf(name, MTI_NAME_MAXLEN, "qsd_reint_%d.%s",
+                qqi->qqi_qtype, qsd->qsd_svname);
+
+       rc = PTR_ERR(kthread_run(qsd_reint_main, (void *)qqi, name));
+       OBD_FREE(name, MTI_NAME_MAXLEN);
+
        if (IS_ERR_VALUE(rc)) {
                thread_set_flags(thread, SVC_STOPPED);
                write_lock(&qsd->qsd_lock);