Commit 5e26fcd8 authored by Lai Siyao's avatar Lai Siyao Committed by Oleg Drokin
Browse files

LU-13709 utils: 'lfs mkdir -i -1' doesn't work



'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: default avatarLai Siyao <lai.siyao@whamcloud.com>
Change-Id: Id4584940cec390a9245e888c96c7873f5afa209e
Reviewed-on: https://review.whamcloud.com/39165

Tested-by: default avatarjenkins <devops@whamcloud.com>
Tested-by: default avatarMaloo <maloo@whamcloud.com>
Reviewed-by: default avatarAndreas Dilger <adilger@whamcloud.com>
Reviewed-by: default avatarOleg Drokin <green@whamcloud.com>
parent 6b6d9c09
......@@ -5356,9 +5356,9 @@ static int lfs_setdirstripe(int argc, char **argv)
}
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 &&
......@@ -5374,11 +5374,15 @@ static int lfs_setdirstripe(int argc, char **argv)
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;
}
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment