From c919cdf5d960da9f3b78fd2c04b7e09ef915d3c6 Mon Sep 17 00:00:00 2001 From: James Nunez Date: Fri, 31 Jul 2015 15:00:03 -0600 Subject: [PATCH] LU-6710 tests: Constrain stripe index conf-sanity test 82a conf-sanity test 82a specifies the OSTs to stripe a file over. The OST index is computed as RANDOM * 2 for a maximum of 65534. Yet, the maximum stripe count is 65532. Thus, the OST index in conf-sanity test 82a needs to be limited. Also, change the single use of the deprecated llapi_stripe_offset_is_valid() to llapi_stripe_index_is_valid(). Signed-off-by: James Nunez Change-Id: I4ceb44d639b88527105c1e8812cbd7590d041316 Reviewed-on: http://review.whamcloud.com/15824 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Saurabh Tandan Reviewed-by: Andreas Dilger --- lustre/tests/conf-sanity.sh | 6 ++++-- lustre/utils/liblustreapi.c | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lustre/tests/conf-sanity.sh b/lustre/tests/conf-sanity.sh index 60f80d9..e18dd58 100644 --- a/lustre/tests/conf-sanity.sh +++ b/lustre/tests/conf-sanity.sh @@ -5428,8 +5428,9 @@ test_82a() { # LU-4665 local i local index local ost_indices + local LOV_V1_INSANE_STRIPE_COUNT=65532 for i in $(seq $OSTCOUNT); do - index=$((RANDOM * 2)) + index=$(((RANDOM * 2) % LOV_V1_INSANE_STRIPE_COUNT)) ost_indices+=" $index" done ost_indices=$(comma_list $ost_indices) @@ -5535,8 +5536,9 @@ test_82b() { # LU-4665 local i local index local ost_indices + local LOV_V1_INSANE_STRIPE_COUNT=65532 for i in $(seq $OSTCOUNT); do - index=$((RANDOM * 2)) + index=$(((RANDOM * 2) % LOV_V1_INSANE_STRIPE_COUNT)) ost_indices+=" $index" done ost_indices=$(comma_list $ost_indices) diff --git a/lustre/utils/liblustreapi.c b/lustre/utils/liblustreapi.c index 094996a..1f9c35f 100644 --- a/lustre/utils/liblustreapi.c +++ b/lustre/utils/liblustreapi.c @@ -274,7 +274,7 @@ int llapi_stripe_limit_check(unsigned long long stripe_size, int stripe_offset, stripe_size, page_size); return rc; } - if (!llapi_stripe_offset_is_valid(stripe_offset)) { + if (!llapi_stripe_index_is_valid(stripe_offset)) { rc = -EINVAL; llapi_error(LLAPI_MSG_ERROR, rc, "error: bad stripe offset %d", stripe_offset); -- 1.8.3.1