Whamcloud - gitweb
LU-12951 lmv: fix to return correct MDT count 13/36713/3
authorWang Shilong <wshilong@ddn.com>
Fri, 8 Nov 2019 04:05:32 +0000 (12:05 +0800)
committerOleg Drokin <green@whamcloud.com>
Tue, 17 Dec 2019 06:01:20 +0000 (06:01 +0000)
@ltd_tgts_size could be larger than actual MDT count,
as we preallocate ltd_tgts and resize it if necessary.

Fix it to use @ld_tgt_count instead.

Change-Id: I1501fd965cc74223c7a77280aac64acdbbcf17f6
Signed-off-by: Wang Shilong <wshilong@ddn.com>
Reviewed-on: https://review.whamcloud.com/36713
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Lai Siyao <lai.siyao@whamcloud.com>
Reviewed-by: Olaf Faaland-LLNL <faaland1@llnl.gov>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
lustre/lmv/lmv_obd.c

index 8af14da..a7f9cb6 100644 (file)
@@ -2930,7 +2930,7 @@ static int lmv_get_info(const struct lu_env *env, struct obd_export *exp,
                        exp->exp_connect_data = *(struct obd_connect_data *)val;
                RETURN(rc);
        } else if (KEY_IS(KEY_TGT_COUNT)) {
-               *((int *)val) = lmv->lmv_mdt_descs.ltd_tgts_size;
+               *((int *)val) = lmv->lmv_mdt_descs.ltd_lmv_desc.ld_tgt_count;
                RETURN(0);
        }