All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xfstests: aio-stress is calling pthread_join incorrectly
@ 2013-06-18 22:57 Dave Kleikamp
  2013-06-18 23:13 ` Dave Chinner
  0 siblings, 1 reply; 3+ messages in thread
From: Dave Kleikamp @ 2013-06-18 22:57 UTC (permalink / raw)
  To: xfs

The retval parameter to pthread_join() is a pointer to a pointer.
aio-stress is passing in a pointer to an int. This can result in a bus
error on sparc64 when the pointer is not aligned on a 64-bit boundary.
Since the return value is not used, it is simplest to pass a NULL
pointer instead.

This has been fixed in the LTP source:
https://github.com/linux-test-project/ltp/commit/981d33aad3b33c4625b88990fbf2fad5470d47e0

Signed-off-by: Dave Kleikamp <dave.kleikamp@oracle.com>
---

diff -up xfstests/ltp/aio-stress.c.orig xfstests/ltp/aio-stress.c
--- xfstests/ltp/aio-stress.c.orig	2013-06-03 11:53:49.000000000 -0700
+++ xfstests/ltp/aio-stress.c	2013-06-18 15:04:35.593859720 -0700
@@ -1210,7 +1210,6 @@ typedef void * (*start_routine)(void *);
 int run_workers(struct thread_info *t, int num_threads)
 {
     int ret;
-    int thread_ret;
     int i;
 
     for(i = 0 ; i < num_threads ; i++) {
@@ -1221,7 +1220,7 @@ int run_workers(struct thread_info *t, i
 	}
     }
     for(i = 0 ; i < num_threads ; i++) {
-        ret = pthread_join(t[i].tid, (void *)&thread_ret);
+        ret = pthread_join(t[i].tid, NULL);
         if (ret) {
 	    perror("pthread_join");
 	    exit(1);

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

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

* Re: [PATCH] xfstests: aio-stress is calling pthread_join incorrectly
  2013-06-18 22:57 [PATCH] xfstests: aio-stress is calling pthread_join incorrectly Dave Kleikamp
@ 2013-06-18 23:13 ` Dave Chinner
  2013-06-26 16:22   ` Ben Myers
  0 siblings, 1 reply; 3+ messages in thread
From: Dave Chinner @ 2013-06-18 23:13 UTC (permalink / raw)
  To: Dave Kleikamp; +Cc: xfs

On Tue, Jun 18, 2013 at 05:57:00PM -0500, Dave Kleikamp wrote:
> The retval parameter to pthread_join() is a pointer to a pointer.
> aio-stress is passing in a pointer to an int. This can result in a bus
> error on sparc64 when the pointer is not aligned on a 64-bit boundary.
> Since the return value is not used, it is simplest to pass a NULL
> pointer instead.
> 
> This has been fixed in the LTP source:
> https://github.com/linux-test-project/ltp/commit/981d33aad3b33c4625b88990fbf2fad5470d47e0
> 
> Signed-off-by: Dave Kleikamp <dave.kleikamp@oracle.com>

Looks good. Thanks, Shaggy.

Reviewed-by: Dave Chinner <dchinner@redhat.com>
-- 
Dave Chinner
david@fromorbit.com

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

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

* Re: [PATCH] xfstests: aio-stress is calling pthread_join incorrectly
  2013-06-18 23:13 ` Dave Chinner
@ 2013-06-26 16:22   ` Ben Myers
  0 siblings, 0 replies; 3+ messages in thread
From: Ben Myers @ 2013-06-26 16:22 UTC (permalink / raw)
  To: Dave Chinner; +Cc: Dave Kleikamp, xfs

On Wed, Jun 19, 2013 at 09:13:14AM +1000, Dave Chinner wrote:
> On Tue, Jun 18, 2013 at 05:57:00PM -0500, Dave Kleikamp wrote:
> > The retval parameter to pthread_join() is a pointer to a pointer.
> > aio-stress is passing in a pointer to an int. This can result in a bus
> > error on sparc64 when the pointer is not aligned on a 64-bit boundary.
> > Since the return value is not used, it is simplest to pass a NULL
> > pointer instead.
> > 
> > This has been fixed in the LTP source:
> > https://github.com/linux-test-project/ltp/commit/981d33aad3b33c4625b88990fbf2fad5470d47e0
> > 
> > Signed-off-by: Dave Kleikamp <dave.kleikamp@oracle.com>
> 
> Looks good. Thanks, Shaggy.
> 
> Reviewed-by: Dave Chinner <dchinner@redhat.com>

Applied.

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

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

end of thread, other threads:[~2013-06-26 16:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-18 22:57 [PATCH] xfstests: aio-stress is calling pthread_join incorrectly Dave Kleikamp
2013-06-18 23:13 ` Dave Chinner
2013-06-26 16:22   ` Ben Myers

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.