Whamcloud - gitweb
LU-1842 quota: don't setup qsd for standalone MGS
authorJohann Lombardi <johann.lombardi@intel.com>
Fri, 5 Oct 2012 22:14:06 +0000 (00:14 +0200)
committerOleg Drokin <green@whamcloud.com>
Sat, 6 Oct 2012 19:08:16 +0000 (15:08 -0400)
Only set up the qsd instance if the associated target is either a MDT
or a OST. We typically have no interest in setting up a QSD instance
on a standalone MGS.

Signed-off-by: Johann Lombardi <johann.lombardi@intel.com>
Change-Id: I0facb08feef0b36f141b749d7be538cbde5f1114
Reviewed-on: http://review.whamcloud.com/4203
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Niu Yawei <niu@whamcloud.com>
Reviewed-by: Alex Zhuravlev <bzzz@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/quota/qsd_lib.c

index c1ba0c3..277791b 100644 (file)
@@ -450,9 +450,14 @@ struct qsd_instance *qsd_init(const struct lu_env *env, char *svname,
 {
        struct qsd_thread_info  *qti = qsd_info(env);
        struct qsd_instance     *qsd;
-       int                      rc;
+       int                      rc, type, idx;
        ENTRY;
 
+       /* only configure qsd for MDT & OST */
+       type = server_name2index(svname, &idx, NULL);
+       if (type != LDD_F_SV_TYPE_MDT && type != LDD_F_SV_TYPE_OST)
+               RETURN(NULL);
+
        /* allocate qsd instance */
        OBD_ALLOC_PTR(qsd);
        if (qsd == NULL)