- thread_set_flags(&qmt->qmt_reba_thread, SVC_STOPPED);
- cfs_waitq_init(&qmt->qmt_reba_thread.t_ctl_waitq);
- CFS_INIT_LIST_HEAD(&qmt->qmt_reba_list);
- cfs_spin_lock_init(&qmt->qmt_reba_lock);
- rc = qmt_start_reba_thread(qmt);
- if (rc) {
- CERROR("%s: failed to start rebalance thread (%d)\n",
- qmt->qmt_svname, rc);
- GOTO(out, rc);
+ INIT_LIST_HEAD(&qmt->qmt_reba_list);
+ spin_lock_init(&qmt->qmt_reba_lock);
+ if (!qmt->qmt_child->dd_rdonly) {
+ rc = qmt_start_reba_thread(qmt);
+ if (rc) {
+ CERROR("%s: failed to start rebalance thread (%d)\n",
+ qmt->qmt_svname, rc);
+ GOTO(out, rc);
+ }