From 60677ddc07dbdf02387c6071bf77626745dbd079 Mon Sep 17 00:00:00 2001 From: adilger Date: Tue, 27 Sep 2005 20:14:54 +0000 Subject: [PATCH] Branch b1_4 Fix stripe test program to properly handle filesystems with default stripe count = -1 (which should result in a full-OST striping). b=9359 --- lustre/tests/ll_dirstripe_verify.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lustre/tests/ll_dirstripe_verify.c b/lustre/tests/ll_dirstripe_verify.c index 903e2a7..c1d18f8 100644 --- a/lustre/tests/ll_dirstripe_verify.c +++ b/lustre/tests/ll_dirstripe_verify.c @@ -69,12 +69,14 @@ int compare(struct lov_user_md *lum_dir, struct lov_user_md *lum_file1, snprintf(lov_path, sizeof(lov_path) - 1, "/proc/fs/lustre/lov/%s", buf); stripe_count = (int)lum_dir->lmm_stripe_count; - if (stripe_count == 0 || stripe_count == (__u16)-1) { + if (stripe_count == 0) { snprintf(tmp_path, sizeof(tmp_path) - 1, "%s/stripecount", lov_path); if (read_proc_entry(tmp_path, buf, sizeof(buf)) <= 0) return 4; stripe_count = atoi(buf); + if (stripe_count == 0) + stripe_count = 1; } snprintf(tmp_path, sizeof(tmp_path) - 1, "%s/numobd", lov_path); @@ -82,7 +84,7 @@ int compare(struct lov_user_md *lum_dir, struct lov_user_md *lum_file1, return 6; ost_count = atoi(buf); - stripe_count = stripe_count ? stripe_count : ost_count; + stripe_count = stripe_count > 0 ? stripe_count : ost_count; if (lum_file1->lmm_stripe_count != stripe_count) { fprintf(stderr, "stripe count %d != %d\n", -- 1.8.3.1