Whamcloud - gitweb
LU-4423 ptlrpc: incorporate BUILD_BUG_ON into ptlrpc_req_async_args()
[fs/lustre-release.git] / lustre / quota / qmt_dev.c
index 32b8ec4..fe65065 100644 (file)
@@ -21,7 +21,7 @@
  * GPL HEADER END
  */
 /*
- * Copyright (c) 2012, 2014, Intel Corporation.
+ * Copyright (c) 2012, 2017, Intel Corporation.
  * Use is subject to license terms.
  *
  * Author: Johann Lombardi <johann.lombardi@intel.com>
@@ -107,7 +107,8 @@ static struct lu_device *qmt_device_fini(const struct lu_env *env,
        }
 
        /* stop rebalance thread */
-       qmt_stop_reba_thread(qmt);
+       if (!qmt->qmt_child->dd_rdonly)
+               qmt_stop_reba_thread(qmt);
 
        /* disconnect from OSD */
        if (qmt->qmt_child_exp != NULL) {
@@ -240,7 +241,7 @@ static int qmt_device_init0(const struct lu_env *env, struct qmt_device *qmt,
                GOTO(out, rc);
 
        /* set up and start rebalance thread */
-       thread_set_flags(&qmt->qmt_reba_thread, SVC_STOPPED);
+       thread_set_flags(&qmt->qmt_reba_thread, SVC_STARTING);
        init_waitqueue_head(&qmt->qmt_reba_thread.t_ctl_waitq);
        INIT_LIST_HEAD(&qmt->qmt_reba_list);
        spin_lock_init(&qmt->qmt_reba_lock);