From patchwork Tue Mar 24 15:25:01 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Rzeszutek X-Patchwork-Id: 14029 X-Patchwork-Delegate: christophe.varoqui@free.fr Received: from hormel.redhat.com (hormel1.redhat.com [209.132.177.33]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n2OFRh9r030092 for ; Tue, 24 Mar 2009 15:27:43 GMT Received: from listman.util.phx.redhat.com (listman.util.phx.redhat.com [10.8.4.110]) by hormel.redhat.com (Postfix) with ESMTP id 8CE2D619962; Tue, 24 Mar 2009 11:27:42 -0400 (EDT) Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by listman.util.phx.redhat.com (8.13.1/8.13.1) with ESMTP id n2OFRdfY014933 for ; Tue, 24 Mar 2009 11:27:39 -0400 Received: from mx1.redhat.com (mx1.redhat.com [172.16.48.31]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n2OFRhiX014712 for ; Tue, 24 Mar 2009 11:27:43 -0400 Received: from mars.virtualiron.com (host-216-57-134-2.customer.veroxity.net [216.57.134.2]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n2OFRMa7028151 for ; Tue, 24 Mar 2009 11:27:22 -0400 Received: by mars.virtualiron.com (Postfix, from userid 1179) id 3EC83204006; Tue, 24 Mar 2009 11:25:01 -0400 (EDT) From: Konrad Rzeszutek To: dm-devel@redhat.com Date: Tue, 24 Mar 2009 11:25:01 -0400 Message-Id: <1237908301-2339-4-git-send-email-konrad@virtualiron.com> In-Reply-To: <1237908301-2339-3-git-send-email-konrad@virtualiron.com> References: <1237908301-2339-1-git-send-email-konrad@virtualiron.com> <1237908301-2339-2-git-send-email-konrad@virtualiron.com> <1237908301-2339-3-git-send-email-konrad@virtualiron.com> X-RedHat-Spam-Score: -0.041 X-Scanned-By: MIMEDefang 2.58 on 172.16.52.254 X-Scanned-By: MIMEDefang 2.63 on 172.16.48.31 X-loop: dm-devel@redhat.com Cc: Subject: [dm-devel] [PATCH] Allocate only once the EMC-clariion global checker's stage area instead of multiple times. X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.5 Precedence: junk Reply-To: device-mapper development List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com The multi-path global context on every path checker init would be set. In scenarios where you have four paths per multipath, that context would be set four times instead of once causing a small memory leak (4 bytes per block disk). --- libmultipath/checkers/emc_clariion.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/libmultipath/checkers/emc_clariion.c b/libmultipath/checkers/emc_clariion.c index 200daee..08c9c26 100644 --- a/libmultipath/checkers/emc_clariion.c +++ b/libmultipath/checkers/emc_clariion.c @@ -76,7 +76,7 @@ int libcheck_init (struct checker * c) /* * Allocate and initialize the multi-path global context. */ - if (c->mpcontext) { + if (c->mpcontext && *c->mpcontext == NULL) { void * mpctxt = MALLOC(sizeof(int)); *c->mpcontext = mpctxt; CLR_INACTIVE_SNAP(c);