Whamcloud - gitweb
Branch b1_4
authoradilger <adilger>
Tue, 27 Sep 2005 20:14:54 +0000 (20:14 +0000)
committeradilger <adilger>
Tue, 27 Sep 2005 20:14:54 +0000 (20:14 +0000)
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

index 903e2a7..c1d18f8 100644 (file)
@@ -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",