From: James Simmons Date: Thu, 18 Oct 2012 12:26:16 +0000 (-0400) Subject: LU-1526 utils: Supply default MDT index X-Git-Tag: 2.3.54~5 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=7712ab3fd86e88f7a8e7d6eb9c82492a8b39a61c;ds=sidebyside LU-1526 utils: Supply default MDT index To prepare for DNE indexing has become a requirement for MDTs and with the latest lustre you can't mount a MDT that was not formated with a index. While mount has this requirement mkfs.lustre has a bug that allows you to format a MDS without a index and not even warn the user. At the same time mkfs.lustre has to handle the case were a user will not supply a index since it was not required in earlier lustre releases. This patch address this problem by supplying a default index of zero for the MDT if no index is supplied to mkfs.lustre and warns the user they must supply a index in the future. Signed-off-by: James Simmons Change-Id: I45932321885856d97b10630a0667e8338822b199 Reviewed-on: http://review.whamcloud.com/4293 Tested-by: Hudson Tested-by: Maloo Reviewed-by: Li Wei Reviewed-by: Andreas Dilger --- diff --git a/lustre/utils/mkfs_lustre.c b/lustre/utils/mkfs_lustre.c index 392e4f1..2e24134 100644 --- a/lustre/utils/mkfs_lustre.c +++ b/lustre/utils/mkfs_lustre.c @@ -639,11 +639,17 @@ int main(int argc, char *const argv[]) goto out; } - if (IS_OST(ldd) && (mop.mo_ldd.ldd_flags & LDD_F_NEED_INDEX)) + if (mop.mo_ldd.ldd_flags & LDD_F_NEED_INDEX) fprintf(stderr, "warning: %s: for Lustre 2.4 and later, the " "target index must be specified with --index\n", mop.mo_device); + /* If no index is supplied for MDT by default set index to zero */ + if (IS_MDT(ldd) && (ldd->ldd_svindex == INDEX_UNASSIGNED)) { + mop.mo_ldd.ldd_flags &= ~LDD_F_NEED_INDEX; + mop.mo_ldd.ldd_svindex = 0; + } + #if 0 /* * Comment out these 2 checks temporarily, since for multi-MDSes