'lfs mkdir -i -1 -c...' is to create directory on MDTs by space usage,
when stripe count is more than 1, the target MDT list is not correctly
initialized, which will cause command fail.
Signed-off-by: Lai Siyao <lai.siyao@whamcloud.com>
Change-Id: Id4584940cec390a9245e888c96c7873f5afa209e
Reviewed-on: https://review.whamcloud.com/39165
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
}
if (auto_distributed) {
- int r;
int nr = MAX(param->lsp_stripe_count,
lsb->sb_count / 2);
+ int r;
/* don't use server whose usage is above 90% */
while (nr != param->lsp_stripe_count &&
lsb->sb_buf[r].sd_index;
if (param->lsp_stripe_count > 1) {
int i = 0;
+ int j;
param->lsp_is_specific = true;
- for (; i < param->lsp_stripe_count; i++)
- param->lsp_tgts[(i + r) % nr] =
- lsb->sb_buf[i].sd_index;
+ for (; i < param->lsp_stripe_count;
+ i++) {
+ j = (i + r) % nr;
+ param->lsp_tgts[i] =
+ lsb->sb_buf[j].sd_index;
+ }
}
}