Skip to contentSkip to conversation

LTP and commit e1d7ba8735551ed7 ("time: Always make sure wall_to_monotonic isn't positive")

DISCUSSION Mark Rutland 2 participants 3 messages Sep 14, 2015 – Sep 24, 2015

lore
Share & tools
lore
#0 lore raw

Hi,

While testing v4.3-rc1 with the LTP, we spotted failures in a couple of timekeeping tests, which seem to be a result of commit e1d7ba8735551ed7 ("time: Always make sure wall_to_monotonic isn't positive").

In both cases this is because the new time would be before the boot time, so I guess these are covered by the caveat at the end of the commit message.

settimeofday01 [1] tries tries to settimeofday() with a timeval 100s and 100ns, while clock_gettime02 [2] tries to clock_settime to 1s and 100ns. Neither expect -EINVAL, and report failure with the new behaviour.

While I don't know that any "real" software is affected, I thought I should let you know.

Thanks,
Mark.

[1] https://github.com/linux-test-project/ltp/blob/20150903/testcases/kernel/syscalls/settimeofday/settimeofday01.c
[2] https://github.com/linux-test-project/ltp/blob/20150903/testcases/kernel/timers/clock_settime/clock_settime02.c

#1 lore raw

Hi!

Quoted 8 lines

While testing v4.3-rc1 with the LTP, we spotted failures in a couple of timekeeping tests, which seem to be a result of commit e1d7ba8735551ed7 ("time: Always make sure wall_to_monotonic isn't positive").

In both cases this is because the new time would be before the boot time, so I guess these are covered by the caveat at the end of the commit message.

Quoted 7 lines

settimeofday01 [1] tries tries to settimeofday() with a timeval 100s and 100ns, while clock_gettime02 [2] tries to clock_settime to 1s and 100ns. Neither expect -EINVAL, and report failure with the new behaviour.

While I don't know that any "real" software is affected, I thought I should let you know.

Thanks for the report, we allready have patch for the first testcase on the mailing list that initializes the the timeval value to current time
+ small amount. I will have a look at the second test as well.

Quoted 2 lines

[1] https://github.com/linux-test-project/ltp/blob/20150903/testcases/kernel/syscalls/settimeofday/settimeofday01.c
[2] https://github.com/linux-test-project/ltp/blob/20150903/testcases/kernel/timers/clock_settime/clock_settime02.c

Signature · 2 lines
Cyril Hrubis
[email protected]
#2 lore raw

Hi!

Quoted 6 lines

Thanks for the report, we allready have patch for the first testcase on the mailing list that initializes the the timeval value to current time
+ small amount. I will have a look at the second test as well.

Quoted 2 lines

[1] https://github.com/linux-test-project/ltp/blob/20150903/testcases/kernel/syscalls/settimeofday/settimeofday01.c
[2] https://github.com/linux-test-project/ltp/blob/20150903/testcases/kernel/timers/clock_settime/clock_settime02.c

Both should be fixed in latest git.

Signature · 2 lines
Cyril Hrubis
[email protected]