From 3499e33e6b3fa3c54f061697d7ee4d08c35f94bd Mon Sep 17 00:00:00 2001 From: Vladislav Bolkhovitin Date: Wed, 18 Feb 2009 19:17:29 +0000 Subject: [PATCH] Patch from Krzysztof Blaszkowski: i noticed this issue running simple iscsi connection test to a few targets. without included patch the active_pages_total counter wraps around 0 thus it breaks logic for releasing memory on "hi watermark" just like it is depicted in: Inactive/active pages 18/-25 Hi/lo watermarks [pages] 119808/0 Hi watermark releases/failures 4/0 git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@676 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/src/scst_mem.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scst/src/scst_mem.c b/scst/src/scst_mem.c index 5dd09ad86..445edc45d 100644 --- a/scst/src/scst_mem.c +++ b/scst/src/scst_mem.c @@ -895,8 +895,8 @@ struct scatterlist *scst_alloc(int size, gfp_t gfp_mask, int *count) atomic_inc(&sgv_pools_mgr.sgv_other_total_alloc); - if (unlikely(!no_fail)) { - if (unlikely(sgv_pool_hiwmk_check(pages) != 0)) { + if (unlikely(sgv_pool_hiwmk_check(pages) != 0)) { + if (!no_fail) { res = NULL; goto out; } @@ -922,7 +922,7 @@ struct scatterlist *scst_alloc(int size, gfp_t gfp_mask, int *count) goto out_free; out: - TRACE_MEM("Alloced sg %p (count %d)", res, *count); + TRACE_MEM("Alloced sg %p (count %d) \"no fail\" %d", res, *count, no_fail); TRACE_EXIT_HRES(res); return res;