Skip to contentSkip to conversation

x86: fix a bug of wrong return erorr.

PATCH In review Liming Wang 2 participants 4 messages Aug 24, 2011 x86

lore
Share & tools
lore
#0 lore raw

cover x86: fix a bug of wrong return erorr.

Fix a bug to make a ltp test work on qemux86-64:
bug 900: [LTP] clock_nanosleep01 fails on qemux86-64

Liming Wang (1):
x86: fix a bug of wrong return erorr.

 arch/x86/vdso/vclock_gettime.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)
#1 lore raw

PATCH 1/1 x86: fix a bug of wrong return erorr.

__vdso_clock_gettime should fall back to call vdso_fallback_gettime function if no clockid is selected, not just return error.

---
 arch/x86/vdso/vclock_gettime.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)
arch/x86/vdso/vclock_gettime.c +0 -2
index 7bc4815..2365a5b 100644
@@ -173,8 +173,6 @@ notrace int __vdso_clock_gettime(clockid_t clock, struct timespec *ts)
 			return do_trace_clock(ts);
 		case CLOCK_TRACE_FREQ:
 			return do_trace_clock_freq(ts);
-		default:
-			return -EINVAL;
 		}
 	return vdso_fallback_gettime(clock, ts);
 }
Signature · 1 line
1.7.0.4
#2 lore raw
Quoted 2 lines · Liming Wang

__vdso_clock_gettime should fall back to call vdso_fallback_gettime function if no clockid is selected, not just return error.

At a glance, this seems reasonable to me .. and then I looked a bit more. This is in fact introduced by lttng and the ENIVAL does look wrong. It's worth checking out the latest lttng to make sure that this error isn't there as well. Our 3.0 kernel won't have this bug yet, but I'll keep an eye out for this during any lttng work.

I'll merge this into the 2.6.37 tree shortly.

Cheers,

Bruce

Quoted 19 lines
---
  arch/x86/vdso/vclock_gettime.c |    2 --
  1 files changed, 0 insertions(+), 2 deletions(-)
arch/x86/vdso/vclock_gettime.c +0 -2
index 7bc4815..2365a5b 100644
@@ -173,8 +173,6 @@ notrace int __vdso_clock_gettime(clockid_t clock, struct timespec *ts)
  			return do_trace_clock(ts);
  		case CLOCK_TRACE_FREQ:
  			return do_trace_clock_freq(ts);
-		default:
-			return -EINVAL;
  		}
  	return vdso_fallback_gettime(clock, ts);
  }
#3 lore raw
Quoted 9 lines · Bruce Ashfield
Quoted 3 lines · Liming Wang

__vdso_clock_gettime should fall back to call vdso_fallback_gettime function
if no clockid is selected, not just return error.

At a glance, this seems reasonable to me .. and then I looked a bit more. This is in fact introduced by lttng and the ENIVAL does look wrong. It's worth checking out the latest lttng to make sure that this error isn't there as

It's still in the latest lttng patch:
http://git.kernel.org/?p=linux/kernel/git/compudj/linux-2.6-lttng.git;a=blobdiff;f=arch/x86/vdso/vclock_gettime.c;h=7bc481508d004c4e8dd0f5cff51aeeac8bfd0766;hp=ee55754cc3c5ff378b76f2065a610b72e757f088;hb=98052998fe2aee4423dc24fccfe991b305969656;hpb=b6c4d0eaca66305984cf1ce6bc9d49a3244b412b

Quoted 1 line

well. Our 3.0 kernel won't have this bug yet, but I'll

Yes, our 3.0 kernel hasn't this bug.

Quoted 3 lines

keep an eye out for this during any lttng work.

I'll merge this into the 2.6.37 tree shortly.

Please replace subject "erorr" with "error" for my fault.

Liming Wang

Quoted 28 lines

Cheers,

Bruce

Quoted 21 lines

---
arch/x86/vdso/vclock_gettime.c | 2 --

1 files changed, 0 insertions(+), 2 deletions(-)
arch/x86/vdso/vclock_gettime.c +0 -0
index 7bc4815..2365a5b 100644
@@ -173,8 +173,6 @@ notrace int __vdso_clock_gettime(clockid_t clock,
 struct timespec *ts)
 return do_trace_clock(ts);

case CLOCK_TRACE_FREQ:
return do_trace_clock_freq(ts);
- default:
- return -EINVAL;
}
return vdso_fallback_gettime(clock, ts);
}