From 31f56f5f40579c68b007bbd048f569f76772f131 Mon Sep 17 00:00:00 2001 From: pravins Date: Thu, 27 Dec 2007 15:38:52 +0000 Subject: [PATCH] b=13906 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 | 2 +- lustre/lov/lov_pack.c | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/lustre/lov/lov_internal.h b/lustre/lov/lov_internal.h index 565cc6f..57d9ba3 100644 --- a/lustre/lov/lov_internal.h +++ b/lustre/lov/lov_internal.h @@ -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); diff --git a/lustre/lov/lov_pack.c b/lustre/lov/lov_pack.c index 6a8acba..ba8663b 100644 --- a/lustre/lov/lov_pack.c +++ b/lustre/lov/lov_pack.c @@ -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; -- 1.8.3.1