All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH 1/3] fsstress: fix memory leaks
@ 2009-09-26 11:34 Andrew Vagin
  2009-09-26 11:34 ` [LTP] [PATCH 2/3] fsstress: fix memory leak in fread_d Andrew Vagin
  2009-09-26 21:29 ` [LTP] [PATCH 1/3] fsstress: fix memory leaks Garrett Cooper
  0 siblings, 2 replies; 7+ messages in thread
From: Andrew Vagin @ 2009-09-26 11:34 UTC (permalink / raw)
  To: subrata; +Cc: ltp-list

==11424== 156 bytes in 1 blocks are definitely lost in loss record 2 of 2
==11424==    at 0x4A0763E: malloc (vg_replace_malloc.c:207)
==11424==    by 0x402E4C: make_freq_table (fsstress.c:986)
==11424==    by 0x401C26: main (fsstress.c:410)

make_freq_table is executed on each iterations, but freq_table is not
changed during test, so this patch moves it from the loop
---
 testcases/kernel/fs/fsstress/fsstress.c |   30 ++++++++++++++++--------------
 1 files changed, 16 insertions(+), 14 deletions(-)

diff --git a/testcases/kernel/fs/fsstress/fsstress.c b/testcases/kernel/fs/fsstress/fsstress.c
index 1f11f6e..3df0ce5 100644
--- a/testcases/kernel/fs/fsstress/fsstress.c
+++ b/testcases/kernel/fs/fsstress/fsstress.c
@@ -375,21 +375,24 @@ int main(int argc, char **argv)
 			break;
 		}
 	}
-        while ( (loopcntr <= loops) || (loops == 0) )
-        {
-		if (no_xfs && errtag) {
-			fprintf(stderr, "error injection only works on XFS\n");
-			exit(1);
-		}
 
-		if (no_xfs) {
-			int i;
-			for (i = 0; ops+i < ops_end; ++i) {
-				if (ops[i].isxfs)
-					ops[i].freq = 0;
-			}
+	if (no_xfs && errtag) {
+		fprintf(stderr, "error injection only works on XFS\n");
+		exit(1);
+	}
+
+	if (no_xfs) {
+		int i;
+		for (i = 0; ops+i < ops_end; ++i) {
+			if (ops[i].isxfs)
+				ops[i].freq = 0;
 		}
-       
+	}
+
+	make_freq_table();
+
+        while ( (loopcntr <= loops) || (loops == 0) )
+        {
        	 	if (!dirname) {
        	     	/* no directory specified */
     	        	if (!nousage) usage();
@@ -407,7 +410,6 @@ int main(int argc, char **argv)
 			maxfsize = (off64_t)MAXFSIZE32;
 		else
 			maxfsize = (off64_t)MAXFSIZE;
-		make_freq_table();
 		dcache_init();
 		setlinebuf(stdout);
 		if (!seed) {
-- 
1.6.2.5


------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2009-09-26 22:47 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-09-26 11:34 [LTP] [PATCH 1/3] fsstress: fix memory leaks Andrew Vagin
2009-09-26 11:34 ` [LTP] [PATCH 2/3] fsstress: fix memory leak in fread_d Andrew Vagin
2009-09-26 11:34   ` [LTP] [PATCH 3/3] fsstress: renew flist if clean up test directory Andrew Vagin
2009-09-26 21:32     ` Garrett Cooper
2009-09-26 21:31   ` [LTP] [PATCH 2/3] fsstress: fix memory leak in fread_d Garrett Cooper
2009-09-26 21:29 ` [LTP] [PATCH 1/3] fsstress: fix memory leaks Garrett Cooper
2009-09-26 22:47   ` Vagin Andrew

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.