X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Fquota%2Fqmt_dev.c;h=19605fad2f34928edebf6ce260571c885ed0e083;hb=ff7ea0aecb1acda87c02c5e5e8a3afee416be7e2;hp=32b8ec49fd9dceeb749c204fabc3af4e71017617;hpb=5963af745b3aa14410d5ceb66f8a7b7d6aaf576a;p=fs%2Flustre-release.git diff --git a/lustre/quota/qmt_dev.c b/lustre/quota/qmt_dev.c index 32b8ec4..19605fa 100644 --- a/lustre/quota/qmt_dev.c +++ b/lustre/quota/qmt_dev.c @@ -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 @@ -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); @@ -258,6 +259,9 @@ static int qmt_device_init0(const struct lu_env *env, struct qmt_device *qmt, type = class_search_type(LUSTRE_QMT_NAME); LASSERT(type != NULL); + /* put reference taken by class_search_type */ + kobject_put(&type->typ_kobj); + /* register proc directory associated with this qmt */ qmt->qmt_proc = lprocfs_register(qmt->qmt_svname, type->typ_procroot, NULL, NULL);