Whamcloud - gitweb
b=13906
authorpravins <pravins>
Thu, 27 Dec 2007 15:38:52 +0000 (15:38 +0000)
committerpravins <pravins>
Thu, 27 Dec 2007 15:38:52 +0000 (15:38 +0000)
i=umka
i=adilger

While sizing the EA, limit the stripe count to the actual number of
OSTs in this filesystem.

lustre/lov/lov_internal.h
lustre/lov/lov_pack.c

index 565cc6f..57d9ba3 100644 (file)
@@ -224,7 +224,7 @@ int lov_fini_statfs_set(struct lov_request_set *set);
 
 /* lov_obd.c */
 void lov_fix_desc(struct lov_desc *desc);
-int lov_get_stripecnt(struct lov_obd *lov, int stripe_count);
+int lov_get_stripecnt(struct lov_obd *lov, __u32 stripe_count);
 void lov_getref(struct obd_device *obd);
 void lov_putref(struct obd_device *obd);
 
index 6a8acba..ba8663b 100644 (file)
@@ -109,7 +109,12 @@ int lov_packmd(struct obd_export *exp, struct lov_mds_md **lmmp,
                                lsm->lsm_magic, LOV_MAGIC);
                         RETURN(-EINVAL);
                 }
-                stripe_count = lsm->lsm_stripe_count;
+                if (!lmmp) {
+                        stripe_count = lov_get_stripecnt(lov, lsm->lsm_stripe_count);
+                        lsm->lsm_stripe_count = stripe_count;
+                } else {
+                        stripe_count = lsm->lsm_stripe_count;
+                }
         }
 
         /* XXX LOV STACKING call into osc for sizes */
@@ -158,7 +163,7 @@ int lov_packmd(struct obd_export *exp, struct lov_mds_md **lmmp,
 }
 
 /* Find the max stripecount we should use */
-int lov_get_stripecnt(struct lov_obd *lov, int stripe_count)
+int lov_get_stripecnt(struct lov_obd *lov, __u32 stripe_count)
 {
         if (!stripe_count)
                 stripe_count = lov->desc.ld_default_stripe_count;