From d52c6af872c780273bf793627d9ae5020866ec4f Mon Sep 17 00:00:00 2001 From: yury Date: Wed, 26 Sep 2007 17:21:56 +0000 Subject: [PATCH] b=2262 r=adilger,nathan - fixed possible divide by zero in ldlm_pools_shrink(); - in ldlm_cancel_lru_local() cancel not more than requested locks in case count is specified (not lru resize case, proc one). --- lustre/ldlm/ldlm_pool.c | 2 +- lustre/ldlm/ldlm_request.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lustre/ldlm/ldlm_pool.c b/lustre/ldlm/ldlm_pool.c index de9d44ca..8900a74 100644 --- a/lustre/ldlm/ldlm_pool.c +++ b/lustre/ldlm/ldlm_pool.c @@ -683,7 +683,7 @@ static int ldlm_pools_shrink(ldlm_side_t client, int nr, total += ldlm_pool_granted(&ns->ns_pool); mutex_up(ldlm_namespace_lock(client)); - if (nr == 0) + if (nr == 0 || total == 0) return total; /* Shrink at least ldlm_namespace_nr(client) namespaces. */ diff --git a/lustre/ldlm/ldlm_request.c b/lustre/ldlm/ldlm_request.c index 2070428..dd03ac1 100644 --- a/lustre/ldlm/ldlm_request.c +++ b/lustre/ldlm/ldlm_request.c @@ -1077,7 +1077,7 @@ int ldlm_cancel_lru_local(struct ldlm_namespace *ns, struct list_head *cancels, if (slv == 1 || lv < slv) break; } else { - if (added > count) + if (added >= count) break; } } else { -- 1.8.3.1