The option flag for stripe-size in the getstripe command was changed
in Lustre 1.8. To detect the correct flag to use, the help was
parsed. However, the help was incorrectly invoked by using the
"--help" option, instead of the correct "lfs help getstripe".
Since interoperability with 1.8 is no longer needed, the incorrect
code is removed and the correct flag is hard-coded.
Test-Parameters: trivial
Lustre-change: https://review.whamcloud.com/28597
Lustre-commit:
ad45173d94e0be94de90368019be52a905bcb993
Signed-off-by: Steve Guminski <stephenx.guminski@intel.com>
Change-Id: I29ae644c7d6b2ed247573d83c943cb556cfb6325
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Signed-off-by: Minh Diep <minh.diep@intel.com>
Reviewed-on: https://review.whamcloud.com/30800
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
LFS_MIGRATE_RSYNC_MODE=${LFS_MIGRATE_RSYNC_MODE:-false}
ECHO=echo
LFS=${LFS:-lfs}
-LFS_SIZE_OPT="-s"
usage() {
cat -- <<USAGE 1>&2
# access the temporary file.
umask 0077
-# This is needed for 1.8 Interoperability and can be removed in the future
-$LFS getstripe --help 2>&1 | grep -q stripe-size && LFS_SIZE_OPT="-S"
-
lfs_migrate() {
while IFS='' read -d '' OLDNAME; do
$ECHO -n "$OLDNAME: "
[ "$OPT_STRIPE_COUNT" ] && COUNT=$OPT_STRIPE_COUNT ||
COUNT=$($LFS getstripe -c "$OLDNAME" \
2> /dev/null)
- SIZE=$($LFS getstripe $LFS_SIZE_OPT "$OLDNAME" \
- 2> /dev/null)
+ SIZE=$($LFS getstripe -S "$OLDNAME" 2> /dev/null)
[ -z "$COUNT" -o -z "$SIZE" ] && UNLINK=""
- SIZE=${LFS_SIZE_OPT}${SIZE}
+ SIZE="-S${SIZE}"
fi
# first try to migrate inside lustre