* [LTP] [PATCH 1/5] lib/safe_file_ops: fix typo
@ 2015-05-13 11:19 Wei,Jiangang
2015-05-13 11:19 ` [LTP] [PATCH 2/5] testcases/kernel/syscalls/fcntl: use TERRNO flag Wei,Jiangang
` (4 more replies)
0 siblings, 5 replies; 8+ messages in thread
From: Wei,Jiangang @ 2015-05-13 11:19 UTC (permalink / raw)
To: ltp-list
s/assigment/assignment/g
s/supressed/suppressed/g
Signed-off-by: Wei,Jiangang <weijg.fnst@cn.fujitsu.com>
---
lib/safe_file_ops.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/safe_file_ops.c b/lib/safe_file_ops.c
index 683c4eb..a46939a 100644
--- a/lib/safe_file_ops.c
+++ b/lib/safe_file_ops.c
@@ -35,8 +35,8 @@
/*
* Count number of expected assigned conversions. Any conversion starts with '%'.
- * The '%%' matches % and no assigment is done. The %*x matches as x would do but
- * the assigment is supressed.
+ * The '%%' matches % and no assignment is done. The %*x matches as x would do but
+ * the assignment is suppressed.
*
* NOTE: This is not 100% correct for complex scanf strings, but will do for
* all of our intended usage.
--
1.9.3
------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply related [flat|nested] 8+ messages in thread* [LTP] [PATCH 2/5] testcases/kernel/syscalls/fcntl: use TERRNO flag 2015-05-13 11:19 [LTP] [PATCH 1/5] lib/safe_file_ops: fix typo Wei,Jiangang @ 2015-05-13 11:19 ` Wei,Jiangang 2015-05-18 11:40 ` Cyril Hrubis 2015-05-13 11:19 ` [LTP] [PATCH 3/5] testcases/kernel: replace umount() with tst_umount() Wei,Jiangang ` (3 subsequent siblings) 4 siblings, 1 reply; 8+ messages in thread From: Wei,Jiangang @ 2015-05-13 11:19 UTC (permalink / raw) To: ltp-list Signed-off-by: Wei,Jiangang <weijg.fnst@cn.fujitsu.com> --- testcases/kernel/syscalls/fcntl/fcntl19.c | 51 ++++++++-------------- testcases/kernel/syscalls/fcntl/fcntl21.c | 72 +++++++++++-------------------- 2 files changed, 43 insertions(+), 80 deletions(-) diff --git a/testcases/kernel/syscalls/fcntl/fcntl19.c b/testcases/kernel/syscalls/fcntl/fcntl19.c index a542cfc..5775684 100644 --- a/testcases/kernel/syscalls/fcntl/fcntl19.c +++ b/testcases/kernel/syscalls/fcntl/fcntl19.c @@ -101,12 +101,11 @@ void setup(void) snprintf(template, PATH_MAX, "fcntl19XXXXXX"); if ((fd = mkstemp(template)) < 0) { - tst_resm(TFAIL, "Couldn't open temp file! errno = %d", errno); + tst_resm(TFAIL|TERRNO, "Couldn't open temp file!"); } if (write(fd, buf, STRINGSIZE) < 0) { - tst_resm(TFAIL, "Couldn't write to temp file! errno = %d", - errno); + tst_resm(TFAIL|TERRNO, "Couldn't write to temp file!"); } memset(&act, 0, sizeof(act)); @@ -114,7 +113,7 @@ void setup(void) sigemptyset(&act.sa_mask); sigaddset(&act.sa_mask, SIGCLD); if ((sigaction(SIGCLD, &act, NULL)) < 0) { - tst_resm(TFAIL, "SIGCLD signal setup failed, errno: %d", errno); + tst_resm(TFAIL|TERRNO, "SIGCLD signal setup failed!"); fail = 1; } } @@ -203,7 +202,7 @@ void unlock_file(void) struct flock fl; if (do_lock(F_SETLK, (short)F_UNLCK, (short)0, 0, 0) < 0) { - tst_resm(TFAIL, "fcntl on file failed, errno =%d", errno); + tst_resm(TFAIL|TERRNO, "fcntl on file failed!"); fail = 1; } do_test(&fl, F_WRLCK, 0, 0, 0); @@ -324,14 +323,12 @@ int main(int ac, char **av) * section just before the lock */ if (do_lock(F_SETLK, (short)F_WRLCK, (short)0, 10, 5) < 0) { - tst_resm(TFAIL, "fcntl on file failed, errno =%d", - errno); + tst_resm(TFAIL|TERRNO, "fcntl on file failed!"); fail = 1; } if (do_lock(F_SETLK, (short)F_UNLCK, (short)0, 5, 5) < 0) { - tst_resm(TFAIL, "fcntl on file failed, errno =%d", - errno); + tst_resm(TFAIL|TERRNO, "fcntl on file failed!"); fail = 1; } @@ -367,14 +364,12 @@ int main(int ac, char **av) * ends at the first byte of the write lock. */ if (do_lock(F_SETLK, (short)F_WRLCK, (short)0, 10, 5) < 0) { - tst_resm(TFAIL, "fcntl on file failed, errno =%d", - errno); + tst_resm(TFAIL|TERRNO, "fcntl on file failed!"); fail = 1; } if (do_lock(F_SETLK, (short)F_UNLCK, (short)0, 5, 6) < 0) { - tst_resm(TFAIL, "fcntl on file failed, errno =%d", - errno); + tst_resm(TFAIL|TERRNO, "fcntl on file failed!"); fail = 1; } @@ -411,14 +406,12 @@ int main(int ac, char **av) * unlock that overlaps the front of the write */ if (do_lock(F_SETLK, (short)F_WRLCK, (short)0, 10, 5) < 0) { - tst_resm(TFAIL, "fcntl on file failed, errno =%d", - errno); + tst_resm(TFAIL|TERRNO, "fcntl on file failed!"); fail = 1; } if (do_lock(F_SETLK, (short)F_UNLCK, (short)0, 5, 8) < 0) { - tst_resm(TFAIL, "fcntl on file failed, errno =%d", - errno); + tst_resm(TFAIL|TERRNO, "fcntl on file failed!"); fail = 1; } @@ -455,14 +448,12 @@ int main(int ac, char **av) * section in the middle of it */ if (do_lock(F_SETLK, (short)F_WRLCK, (short)0, 10, 10) < 0) { - tst_resm(TFAIL, "fcntl on file failed, errno =%d", - errno); + tst_resm(TFAIL|TERRNO, "fcntl on file failed!"); fail = 1; } if (do_lock(F_SETLK, (short)F_UNLCK, (short)0, 13, 5) < 0) { - tst_resm(TFAIL, "fcntl on file failed, errno =%d", - errno); + tst_resm(TFAIL|TERRNO, "fcntl on file failed!"); fail = 1; } @@ -505,14 +496,12 @@ int main(int ac, char **av) * unlock that overlaps the end */ if (do_lock(F_SETLK, (short)F_WRLCK, (short)0, 10, 5) < 0) { - tst_resm(TFAIL, "fcntl on file failed, errno =%d", - errno); + tst_resm(TFAIL|TERRNO, "fcntl on file failed!"); fail = 1; } if (do_lock(F_SETLK, (short)F_UNLCK, (short)0, 13, 5) < 0) { - tst_resm(TFAIL, "fcntl on file failed, errno =%d", - errno); + tst_resm(TFAIL|TERRNO, "fcntl on file failed!"); fail = 1; } @@ -549,14 +538,12 @@ int main(int ac, char **av) * starting at the last byte of the write lock */ if (do_lock(F_SETLK, (short)F_WRLCK, (short)0, 10, 5) < 0) { - tst_resm(TFAIL, "fcntl on file failed, errno =%d", - errno); + tst_resm(TFAIL|TERRNO, "fcntl on file failed!"); fail = 1; } if (do_lock(F_SETLK, (short)F_UNLCK, (short)0, 14, 5) < 0) { - tst_resm(TFAIL, "fcntl on file failed, errno =%d", - errno); + tst_resm(TFAIL|TERRNO, "fcntl on file failed!"); fail = 1; } @@ -594,14 +581,12 @@ int main(int ac, char **av) * lock */ if (do_lock(F_SETLK, (short)F_WRLCK, (short)0, 10, 5) < 0) { - tst_resm(TFAIL, "fcntl on file failed, errno =%d", - errno); + tst_resm(TFAIL|TERRNO, "fcntl on file failed!"); fail = 1; } if (do_lock(F_SETLK, (short)F_UNLCK, (short)0, 16, 0) < 0) { - tst_resm(TFAIL, "fcntl on file failed, errno =%d", - errno); + tst_resm(TFAIL|TERRNO, "fcntl on file failed!"); fail = 1; } diff --git a/testcases/kernel/syscalls/fcntl/fcntl21.c b/testcases/kernel/syscalls/fcntl/fcntl21.c index 5307021..b59b128 100644 --- a/testcases/kernel/syscalls/fcntl/fcntl21.c +++ b/testcases/kernel/syscalls/fcntl/fcntl21.c @@ -99,12 +99,11 @@ void setup(void) snprintf(template, PATH_MAX, "fcntl21XXXXXX"); if ((fd = mkstemp(template)) < 0) { - tst_resm(TFAIL, "Couldn't open temp file! errno = %d", errno); + tst_resm(TFAIL|TERRNO, "Couldn't open temp file!"); } if (write(fd, buf, STRINGSIZE) < 0) { - tst_resm(TFAIL, "Couldn't write to temp file! errno = %d", - errno); + tst_resm(TFAIL|TERRNO, "Couldn't write to temp file!"); } memset(&act, 0, sizeof(act)); @@ -112,7 +111,7 @@ void setup(void) sigemptyset(&act.sa_mask); sigaddset(&act.sa_mask, SIGCLD); if ((sigaction(SIGCLD, &act, NULL)) < 0) { - tst_resm(TFAIL, "SIGCLD signal setup failed, errno: %d", errno); + tst_resm(TFAIL|TERRNO, "SIGCLD signal setup failed!"); fail = 1; } } @@ -138,8 +137,7 @@ void do_child(void) while (1) { child_get(&fl); if (fcntl(fd, F_GETLK, &fl) < 0) { - tst_resm(TFAIL, "fcntl on file failed, errno =%d", - errno); + tst_resm(TFAIL|TERRNO, "fcntl on file failed!"); fail = 1; } child_put(&fl); @@ -210,7 +208,7 @@ void unlock_file(void) struct flock fl; if (do_lock(F_SETLK, (short)F_UNLCK, (short)0, 0, 0) < 0) { - tst_resm(TFAIL, "fcntl on file failed, errno =%d", errno); + tst_resm(TFAIL|TERRNO, "fcntl on file failed!"); fail = 1; } do_test(&fl, F_WRLCK, 0, 0, 0); @@ -330,8 +328,7 @@ int main(int ac, char **av) * Set a read lock on the whole file */ if (do_lock(F_SETLK, (short)F_RDLCK, (short)0, 0, 0) < 0) { - tst_resm(TFAIL, "fcntl on file failed, errno =%d", - errno); + tst_resm(TFAIL|TERRNO, "fcntl on file failed!"); fail = 1; } @@ -361,8 +358,7 @@ int main(int ac, char **av) * Set a write lock on the whole file */ if (do_lock(F_SETLK, (short)F_WRLCK, (short)0, 0, 0) < 0) { - tst_resm(TFAIL, "fcntl on file failed, errno =%d", - errno); + tst_resm(TFAIL|TERRNO, "fcntl on file failed!"); fail = 1; } @@ -394,14 +390,12 @@ int main(int ac, char **av) * at the begining */ if (do_lock(F_SETLK, (short)F_RDLCK, (short)0, 10, 5) < 0) { - tst_resm(TFAIL, "fcntl on file failed, errno =%d", - errno); + tst_resm(TFAIL|TERRNO, "fcntl on file failed!"); fail = 1; } if (do_lock(F_SETLK, (short)F_WRLCK, (short)0, 1, 5) < 0) { - tst_resm(TFAIL, "fcntl on file failed, errno =%d", - errno); + tst_resm(TFAIL|TERRNO, "fcntl on file failed!"); fail = 1; } @@ -444,14 +438,12 @@ int main(int ac, char **av) * write lock just before */ if (do_lock(F_SETLK, (short)F_RDLCK, (short)0, 10, 5) < 0) { - tst_resm(TFAIL, "fcntl on file failed, errno =%d", - errno); + tst_resm(TFAIL|TERRNO, "fcntl on file failed!"); fail = 1; } if (do_lock(F_SETLK, (short)F_WRLCK, (short)0, 5, 5) < 0) { - tst_resm(TFAIL, "fcntl on file failed, errno =%d", - errno); + tst_resm(TFAIL|TERRNO, "fcntl on file failed!"); fail = 1; } @@ -494,14 +486,12 @@ int main(int ac, char **av) * ends at the first byte of the read lock */ if (do_lock(F_SETLK, (short)F_RDLCK, (short)0, 10, 5) < 0) { - tst_resm(TFAIL, "fcntl on file failed, errno =%d", - errno); + tst_resm(TFAIL|TERRNO, "fcntl on file failed!"); fail = 1; } if (do_lock(F_SETLK, (short)F_WRLCK, (short)0, 5, 6) < 0) { - tst_resm(TFAIL, "fcntl on file failed, errno =%d", - errno); + tst_resm(TFAIL|TERRNO, "fcntl on file failed!"); fail = 1; } @@ -544,14 +534,12 @@ int main(int ac, char **av) * lock that overlaps the front of the read. */ if (do_lock(F_SETLK, (short)F_RDLCK, (short)0, 10, 5) < 0) { - tst_resm(TFAIL, "fcntl on file failed, errno =%d", - errno); + tst_resm(TFAIL|TERRNO, "fcntl on file failed!"); fail = 1; } if (do_lock(F_SETLK, (short)F_WRLCK, (short)0, 5, 8) < 0) { - tst_resm(TFAIL, "fcntl on file failed, errno =%d", - errno); + tst_resm(TFAIL|TERRNO, "fcntl on file failed!"); fail = 1; } @@ -594,14 +582,12 @@ int main(int ac, char **av) * lock in the middle of it */ if (do_lock(F_SETLK, (short)F_RDLCK, (short)0, 10, 10) < 0) { - tst_resm(TFAIL, "fcntl on file failed, errno =%d", - errno); + tst_resm(TFAIL|TERRNO, "fcntl on file failed!"); fail = 1; } if (do_lock(F_SETLK, (short)F_WRLCK, (short)0, 13, 5) < 0) { - tst_resm(TFAIL, "fcntl on file failed, errno =%d", - errno); + tst_resm(TFAIL|TERRNO, "fcntl on file failed!"); fail = 1; } @@ -648,8 +634,7 @@ int main(int ac, char **av) * lock that overlaps the end */ if (do_lock(F_SETLK, (short)F_RDLCK, (short)0, 10, 5) < 0) { - tst_resm(TFAIL, "fcntl on file failed, errno =%d", - errno); + tst_resm(TFAIL|TERRNO, "fcntl on file failed!"); fail = 1; } @@ -657,8 +642,7 @@ int main(int ac, char **av) * Set a write lock on the whole file */ if (do_lock(F_SETLK, (short)F_WRLCK, (short)0, 13, 5) < 0) { - tst_resm(TFAIL, "fcntl on file failed, errno =%d", - errno); + tst_resm(TFAIL|TERRNO, "fcntl on file failed!"); fail = 1; } @@ -701,8 +685,7 @@ int main(int ac, char **av) * lock starting at the last byte of the read lock */ if (do_lock(F_SETLK, (short)F_RDLCK, (short)0, 10, 5) < 0) { - tst_resm(TFAIL, "fcntl on file failed, errno =%d", - errno); + tst_resm(TFAIL|TERRNO, "fcntl on file failed!"); fail = 1; } @@ -710,8 +693,7 @@ int main(int ac, char **av) * Set a write lock on the whole file. */ if (do_lock(F_SETLK, (short)F_WRLCK, (short)0, 14, 5) < 0) { - tst_resm(TFAIL, "fcntl on file failed, errno =%d", - errno); + tst_resm(TFAIL|TERRNO, "fcntl on file failed!"); fail = 1; } @@ -755,8 +737,7 @@ int main(int ac, char **av) * read lock. */ if (do_lock(F_SETLK, (short)F_RDLCK, (short)0, 10, 5) < 0) { - tst_resm(TFAIL, "fcntl on file failed, errno =%d", - errno); + tst_resm(TFAIL|TERRNO, "fcntl on file failed!"); fail = 1; } @@ -764,8 +745,7 @@ int main(int ac, char **av) * Set a write lock on the whole file */ if (do_lock(F_SETLK, (short)F_WRLCK, (short)0, 15, 5) < 0) { - tst_resm(TFAIL, "fcntl on file failed, errno =%d", - errno); + tst_resm(TFAIL|TERRNO, "fcntl on file failed!"); fail = 1; } @@ -808,14 +788,12 @@ int main(int ac, char **av) * lock that starts past the end of the read lock. */ if (do_lock(F_SETLK, (short)F_RDLCK, (short)0, 10, 5) < 0) { - tst_resm(TFAIL, "fcntl on file failed, errno =%d", - errno); + tst_resm(TFAIL|TERRNO, "fcntl on file failed!"); fail = 1; } if (do_lock(F_SETLK, (short)F_WRLCK, (short)0, 16, 5) < 0) { - tst_resm(TFAIL, "fcntl on file failed, errno =%d", - errno); + tst_resm(TFAIL|TERRNO, "fcntl on file failed!"); fail = 1; } -- 1.9.3 ------------------------------------------------------------------------------ One dashboard for servers and applications across Physical-Virtual-Cloud Widest out-of-the-box monitoring support with 50+ applications Performance metrics, stats and reports that give you Actionable Insights Deep dive visibility with transaction tracing using APM Insight. http://ad.doubleclick.net/ddm/clk/290420510;117567292;y _______________________________________________ Ltp-list mailing list Ltp-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ltp-list ^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [LTP] [PATCH 2/5] testcases/kernel/syscalls/fcntl: use TERRNO flag 2015-05-13 11:19 ` [LTP] [PATCH 2/5] testcases/kernel/syscalls/fcntl: use TERRNO flag Wei,Jiangang @ 2015-05-18 11:40 ` Cyril Hrubis 0 siblings, 0 replies; 8+ messages in thread From: Cyril Hrubis @ 2015-05-18 11:40 UTC (permalink / raw) To: Wei,Jiangang; +Cc: ltp-list Hi! > diff --git a/testcases/kernel/syscalls/fcntl/fcntl19.c b/testcases/kernel/syscalls/fcntl/fcntl19.c > index a542cfc..5775684 100644 > --- a/testcases/kernel/syscalls/fcntl/fcntl19.c > +++ b/testcases/kernel/syscalls/fcntl/fcntl19.c > @@ -101,12 +101,11 @@ void setup(void) > snprintf(template, PATH_MAX, "fcntl19XXXXXX"); > > if ((fd = mkstemp(template)) < 0) { > - tst_resm(TFAIL, "Couldn't open temp file! errno = %d", errno); > + tst_resm(TFAIL|TERRNO, "Couldn't open temp file!"); Technically this is a good change, but the code was broken beforehand. The correct thing to do here is: tst_brkm(TBROK | TERRNO, cleanup, "Couldn't open temp file."); Otherwise the testcase will attempt to call write() on fd == -1. Moreover it can also do simple open instead of mkstemp() because the temporary directory made with tst_tmpdir() is unique itself. > } > > if (write(fd, buf, STRINGSIZE) < 0) { > - tst_resm(TFAIL, "Couldn't write to temp file! errno = %d", > - errno); > + tst_resm(TFAIL|TERRNO, "Couldn't write to temp file!"); > } Here it could be changed to SAFE_WRITE(); > memset(&act, 0, sizeof(act)); > @@ -114,7 +113,7 @@ void setup(void) > sigemptyset(&act.sa_mask); > sigaddset(&act.sa_mask, SIGCLD); > if ((sigaction(SIGCLD, &act, NULL)) < 0) { > - tst_resm(TFAIL, "SIGCLD signal setup failed, errno: %d", errno); > + tst_resm(TFAIL|TERRNO, "SIGCLD signal setup failed!"); > fail = 1; > } > } > @@ -203,7 +202,7 @@ void unlock_file(void) > struct flock fl; > > if (do_lock(F_SETLK, (short)F_UNLCK, (short)0, 0, 0) < 0) { > - tst_resm(TFAIL, "fcntl on file failed, errno =%d", errno); > + tst_resm(TFAIL|TERRNO, "fcntl on file failed!"); > fail = 1; > } Hmm, this should be tst_brkm(TBROK ... ); as well as this is not the test but rather cleanup/preparation for next test. Basically all cases where some prepartion fails should be TBROK rather than TFAIL and should also exit the test if needed preparation steps have failed. -- Cyril Hrubis chrubis@suse.cz ------------------------------------------------------------------------------ One dashboard for servers and applications across Physical-Virtual-Cloud Widest out-of-the-box monitoring support with 50+ applications Performance metrics, stats and reports that give you Actionable Insights Deep dive visibility with transaction tracing using APM Insight. http://ad.doubleclick.net/ddm/clk/290420510;117567292;y _______________________________________________ Ltp-list mailing list Ltp-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ltp-list ^ permalink raw reply [flat|nested] 8+ messages in thread
* [LTP] [PATCH 3/5] testcases/kernel: replace umount() with tst_umount() 2015-05-13 11:19 [LTP] [PATCH 1/5] lib/safe_file_ops: fix typo Wei,Jiangang 2015-05-13 11:19 ` [LTP] [PATCH 2/5] testcases/kernel/syscalls/fcntl: use TERRNO flag Wei,Jiangang @ 2015-05-13 11:19 ` Wei,Jiangang 2015-05-13 11:19 ` [LTP] [PATCH 4/5] testcases/kernel/fs/doio: free memory Wei,Jiangang ` (2 subsequent siblings) 4 siblings, 0 replies; 8+ messages in thread From: Wei,Jiangang @ 2015-05-13 11:19 UTC (permalink / raw) To: ltp-list Signed-off-by: Wei,Jiangang <weijg.fnst@cn.fujitsu.com> --- testcases/kernel/io/direct_io/dma_thread_diotest.c | 2 +- testcases/kernel/syscalls/ftruncate/ftruncate04.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/testcases/kernel/io/direct_io/dma_thread_diotest.c b/testcases/kernel/io/direct_io/dma_thread_diotest.c index 877b707..6ac1dec 100644 --- a/testcases/kernel/io/direct_io/dma_thread_diotest.c +++ b/testcases/kernel/io/direct_io/dma_thread_diotest.c @@ -429,7 +429,7 @@ static void cleanup(void) { free(buffer); - if (mount_flag && umount(MNT_POINT) < 0) + if (mount_flag && tst_umount(MNT_POINT) < 0) tst_resm(TWARN | TERRNO, "umount device:%s failed", device); free(worker); diff --git a/testcases/kernel/syscalls/ftruncate/ftruncate04.c b/testcases/kernel/syscalls/ftruncate/ftruncate04.c index 99aebfe..2136227 100644 --- a/testcases/kernel/syscalls/ftruncate/ftruncate04.c +++ b/testcases/kernel/syscalls/ftruncate/ftruncate04.c @@ -248,7 +248,7 @@ static void setup(void) static void cleanup(void) { - if (mount_flag && umount(MOUNT_DIR)) + if (mount_flag && tst_umount(MOUNT_DIR)) tst_resm(TWARN | TERRNO, "umount(%s) failed", device); if (device) -- 1.9.3 ------------------------------------------------------------------------------ One dashboard for servers and applications across Physical-Virtual-Cloud Widest out-of-the-box monitoring support with 50+ applications Performance metrics, stats and reports that give you Actionable Insights Deep dive visibility with transaction tracing using APM Insight. http://ad.doubleclick.net/ddm/clk/290420510;117567292;y _______________________________________________ Ltp-list mailing list Ltp-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ltp-list ^ permalink raw reply related [flat|nested] 8+ messages in thread
* [LTP] [PATCH 4/5] testcases/kernel/fs/doio: free memory 2015-05-13 11:19 [LTP] [PATCH 1/5] lib/safe_file_ops: fix typo Wei,Jiangang 2015-05-13 11:19 ` [LTP] [PATCH 2/5] testcases/kernel/syscalls/fcntl: use TERRNO flag Wei,Jiangang 2015-05-13 11:19 ` [LTP] [PATCH 3/5] testcases/kernel: replace umount() with tst_umount() Wei,Jiangang @ 2015-05-13 11:19 ` Wei,Jiangang 2015-05-18 11:28 ` Cyril Hrubis 2015-05-13 11:19 ` [LTP] [PATCH 5/5] network/nfs/nfsstress: fix printf format Wei,Jiangang 2015-05-18 11:45 ` [LTP] [PATCH 1/5] lib/safe_file_ops: fix typo Cyril Hrubis 4 siblings, 1 reply; 8+ messages in thread From: Wei,Jiangang @ 2015-05-13 11:19 UTC (permalink / raw) To: ltp-list free the memory that allocated by malloc and strdup. Signed-off-by: Wei,Jiangang <weijg.fnst@cn.fujitsu.com> --- testcases/kernel/fs/doio/doio.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/testcases/kernel/fs/doio/doio.c b/testcases/kernel/fs/doio/doio.c index 4b0dec5..f5b9d66 100644 --- a/testcases/kernel/fs/doio/doio.c +++ b/testcases/kernel/fs/doio/doio.c @@ -1360,6 +1360,7 @@ char *format_rw(struct io_req *ioreq, int fd, void *buffer, int signo, break; } + free(aio_strat); return errbuf; } @@ -2071,6 +2072,8 @@ char *format_listio(struct io_req *ioreq, int lcmd, struct listreq *list, sprintf(cp, " io completion strategy is %s\n", aio_strat); } + free(aio_strat); + return errbuf; } #endif /* CRAY */ @@ -2558,6 +2561,7 @@ struct status *sy_listio(struct io_req *req, struct syscall_info *sysc, int fd, } status->aioid = malloc((nents + 1) * sizeof(int)); if (status->aioid == NULL) { + free(status); doio_fprintf(stderr, "malloc failed, %s/%d\n", __FILE__, __LINE__); return NULL; @@ -2567,6 +2571,8 @@ struct status *sy_listio(struct io_req *req, struct syscall_info *sysc, int fd, lio_req = malloc(nents * sizeof(struct listreq)); if (lio_req == NULL) { + free(status->aioid); + free(status); doio_fprintf(stderr, "malloc failed, %s/%d\n", __FILE__, __LINE__); return NULL; -- 1.9.3 ------------------------------------------------------------------------------ One dashboard for servers and applications across Physical-Virtual-Cloud Widest out-of-the-box monitoring support with 50+ applications Performance metrics, stats and reports that give you Actionable Insights Deep dive visibility with transaction tracing using APM Insight. http://ad.doubleclick.net/ddm/clk/290420510;117567292;y _______________________________________________ Ltp-list mailing list Ltp-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ltp-list ^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [LTP] [PATCH 4/5] testcases/kernel/fs/doio: free memory 2015-05-13 11:19 ` [LTP] [PATCH 4/5] testcases/kernel/fs/doio: free memory Wei,Jiangang @ 2015-05-18 11:28 ` Cyril Hrubis 0 siblings, 0 replies; 8+ messages in thread From: Cyril Hrubis @ 2015-05-18 11:28 UTC (permalink / raw) To: Wei,Jiangang; +Cc: ltp-list Hi! > free the memory that allocated by malloc and strdup. You keep fixing the code inside the CRAY #ifdefs. Cray systems are not supported for some time anyway. It would be far easier to just remove the unused code between the CRAY and sgi ifdefs. -- Cyril Hrubis chrubis@suse.cz ------------------------------------------------------------------------------ One dashboard for servers and applications across Physical-Virtual-Cloud Widest out-of-the-box monitoring support with 50+ applications Performance metrics, stats and reports that give you Actionable Insights Deep dive visibility with transaction tracing using APM Insight. http://ad.doubleclick.net/ddm/clk/290420510;117567292;y _______________________________________________ Ltp-list mailing list Ltp-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ltp-list ^ permalink raw reply [flat|nested] 8+ messages in thread
* [LTP] [PATCH 5/5] network/nfs/nfsstress: fix printf format 2015-05-13 11:19 [LTP] [PATCH 1/5] lib/safe_file_ops: fix typo Wei,Jiangang ` (2 preceding siblings ...) 2015-05-13 11:19 ` [LTP] [PATCH 4/5] testcases/kernel/fs/doio: free memory Wei,Jiangang @ 2015-05-13 11:19 ` Wei,Jiangang 2015-05-18 11:45 ` [LTP] [PATCH 1/5] lib/safe_file_ops: fix typo Cyril Hrubis 4 siblings, 0 replies; 8+ messages in thread From: Wei,Jiangang @ 2015-05-13 11:19 UTC (permalink / raw) To: ltp-list format string requires 2 parameters but only 1 is given Signed-off-by: Wei,Jiangang <weijg.fnst@cn.fujitsu.com> --- testcases/network/nfs/nfsstress/make_tree.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/testcases/network/nfs/nfsstress/make_tree.c b/testcases/network/nfs/nfsstress/make_tree.c index 7b18da3..4163988 100644 --- a/testcases/network/nfs/nfsstress/make_tree.c +++ b/testcases/network/nfs/nfsstress/make_tree.c @@ -319,7 +319,8 @@ static int init_compile(int what_todo, /* do a compile or clean */ return 1; } - dprt("pid[%d]: init_compile(): status = %d\n", status); + dprt("pid[%d]: init_compile(): status = %d\n", + gettid(), status); dprt("we are here %d\n", __LINE__); return status; } -- 1.9.3 ------------------------------------------------------------------------------ One dashboard for servers and applications across Physical-Virtual-Cloud Widest out-of-the-box monitoring support with 50+ applications Performance metrics, stats and reports that give you Actionable Insights Deep dive visibility with transaction tracing using APM Insight. http://ad.doubleclick.net/ddm/clk/290420510;117567292;y _______________________________________________ Ltp-list mailing list Ltp-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ltp-list ^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [LTP] [PATCH 1/5] lib/safe_file_ops: fix typo 2015-05-13 11:19 [LTP] [PATCH 1/5] lib/safe_file_ops: fix typo Wei,Jiangang ` (3 preceding siblings ...) 2015-05-13 11:19 ` [LTP] [PATCH 5/5] network/nfs/nfsstress: fix printf format Wei,Jiangang @ 2015-05-18 11:45 ` Cyril Hrubis 4 siblings, 0 replies; 8+ messages in thread From: Cyril Hrubis @ 2015-05-18 11:45 UTC (permalink / raw) To: Wei,Jiangang; +Cc: ltp-list Hi! Patches: lib/safe_file_ops: fix typo testcases/kernel: replace umount() with tst_umount() network/nfs/nfsstress: fix printf format Pushed, thanks. -- Cyril Hrubis chrubis@suse.cz ------------------------------------------------------------------------------ One dashboard for servers and applications across Physical-Virtual-Cloud Widest out-of-the-box monitoring support with 50+ applications Performance metrics, stats and reports that give you Actionable Insights Deep dive visibility with transaction tracing using APM Insight. http://ad.doubleclick.net/ddm/clk/290420510;117567292;y _______________________________________________ Ltp-list mailing list Ltp-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ltp-list ^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2015-05-18 11:45 UTC | newest] Thread overview: 8+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2015-05-13 11:19 [LTP] [PATCH 1/5] lib/safe_file_ops: fix typo Wei,Jiangang 2015-05-13 11:19 ` [LTP] [PATCH 2/5] testcases/kernel/syscalls/fcntl: use TERRNO flag Wei,Jiangang 2015-05-18 11:40 ` Cyril Hrubis 2015-05-13 11:19 ` [LTP] [PATCH 3/5] testcases/kernel: replace umount() with tst_umount() Wei,Jiangang 2015-05-13 11:19 ` [LTP] [PATCH 4/5] testcases/kernel/fs/doio: free memory Wei,Jiangang 2015-05-18 11:28 ` Cyril Hrubis 2015-05-13 11:19 ` [LTP] [PATCH 5/5] network/nfs/nfsstress: fix printf format Wei,Jiangang 2015-05-18 11:45 ` [LTP] [PATCH 1/5] lib/safe_file_ops: fix typo Cyril Hrubis
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox