From: zhanghc Date: Wed, 24 Dec 2008 11:18:36 +0000 (+0000) Subject: b=18043 X-Git-Tag: v1_8_0_110~358 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=8400a50b3614c1b300d2855c3c35e92c04de6584;p=fs%2Flustre-release.git b=18043 fix a bug in lov_ost_pool_extend, which use "min" instead of "max" incorrectly i=nathan.rutman i=jc.lafoucriere --- diff --git a/lustre/lov/lov_internal.h b/lustre/lov/lov_internal.h index 4f4d72f..cd689b7 100644 --- a/lustre/lov/lov_internal.h +++ b/lustre/lov/lov_internal.h @@ -311,8 +311,8 @@ extern lustre_hash_ops_t pool_hash_operations; /* ost_pool methods */ int lov_ost_pool_init(struct ost_pool *op, unsigned int count); -int lov_ost_pool_extend(struct ost_pool *op, unsigned int max_count); -int lov_ost_pool_add(struct ost_pool *op, __u32 idx, unsigned int max_count); +int lov_ost_pool_extend(struct ost_pool *op, unsigned int min_count); +int lov_ost_pool_add(struct ost_pool *op, __u32 idx, unsigned int min_count); int lov_ost_pool_remove(struct ost_pool *op, __u32 idx); int lov_ost_pool_free(struct ost_pool *op); diff --git a/lustre/lov/lov_pool.c b/lustre/lov/lov_pool.c index e506d70..d9edaab 100644 --- a/lustre/lov/lov_pool.c +++ b/lustre/lov/lov_pool.c @@ -316,17 +316,17 @@ int lov_ost_pool_init(struct ost_pool *op, unsigned int count) } /* Caller must hold write op_rwlock */ -int lov_ost_pool_extend(struct ost_pool *op, unsigned int max_count) +int lov_ost_pool_extend(struct ost_pool *op, unsigned int min_count) { __u32 *new; int new_size; - LASSERT(max_count != 0); + LASSERT(min_count != 0); if (op->op_count < op->op_size) return 0; - new_size = min(max_count, 2 * op->op_size); + new_size = max(min_count, 2 * op->op_size); OBD_ALLOC(new, new_size * sizeof(op->op_array[0])); if (new == NULL) return -ENOMEM; @@ -339,14 +339,14 @@ int lov_ost_pool_extend(struct ost_pool *op, unsigned int max_count) return 0; } -int lov_ost_pool_add(struct ost_pool *op, __u32 idx, unsigned int max_count) +int lov_ost_pool_add(struct ost_pool *op, __u32 idx, unsigned int min_count) { int rc = 0, i; ENTRY; down_write(&op->op_rw_sem); - rc = lov_ost_pool_extend(op, max_count); + rc = lov_ost_pool_extend(op, min_count); if (rc) GOTO(out, rc);