[RFC][PATCH 3/4] ntp: Use printk_deferred in leapsecond path

From: John Stultz
Date: Fri May 29 2015 - 16:24:58 EST


Looking over the leapsecond code, I noticed the printk messages
reporting the leapsecond insertion in the second_overflow path
were not using the printk_deferred method. This was surprising
since the printk_deferred method was added in part to avoid
printk-ing while holding the timekeeping locks.

See 6d9bcb621b0b (timekeeping: use printk_deferred when holding
timekeeping seqlock) for further rational.

I can only guess that this omission was a git add -p oversight.

Folks particularly worried about leapsecond crashes should
probably pay attention to this patch. Pending review, Its likely
a -stable candidate.

Cc: Prarit Bhargava <prarit@xxxxxxxxxx>
Cc: Daniel Bristot de Oliveira <bristot@xxxxxxxxxx>
Cc: Richard Cochran <richardcochran@xxxxxxxxx>
Cc: Jan Kara <jack@xxxxxxx>
Cc: Jiri Bohac <jbohac@xxxxxxx>
Cc: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
Cc: Ingo Molnar <mingo@xxxxxxxxxx>
Cc: Shuah Khan <shuahkh@xxxxxxxxxxxxxxx>
Signed-off-by: John Stultz <john.stultz@xxxxxxxxxx>
---
kernel/time/ntp.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/time/ntp.c b/kernel/time/ntp.c
index 7a68100..472591e 100644
--- a/kernel/time/ntp.c
+++ b/kernel/time/ntp.c
@@ -393,7 +393,7 @@ int second_overflow(unsigned long secs)
else if (secs % 86400 == 0) {
leap = -1;
time_state = TIME_OOP;
- printk(KERN_NOTICE
+ printk_deferred(KERN_NOTICE
"Clock: inserting leap second 23:59:60 UTC\n");
}
break;
@@ -403,7 +403,7 @@ int second_overflow(unsigned long secs)
else if ((secs + 1) % 86400 == 0) {
leap = 1;
time_state = TIME_WAIT;
- printk(KERN_NOTICE
+ printk_deferred(KERN_NOTICE
"Clock: deleting leap second 23:59:59 UTC\n");
}
break;
--
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/