Commit 2e50b6ccdaaf0d933bb9d8409cac4b2f088f5a2f
Committed by
Linus Torvalds
1 parent
aab3c3b01d
Exists in
master
and in
20 other branches
fs/binfmt_aout.c: use printk_ratelimit()
Use printk_ratelimit() instead of jiffies based arithmetic, suggested by Geert Uytterhoeven Signed-off-by: S.Caglar Onur <caglar@pardus.org.tr> Cc: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Showing 1 changed file with 3 additions and 9 deletions Side-by-side Diff
fs/binfmt_aout.c
... | ... | @@ -372,21 +372,17 @@ |
372 | 372 | |
373 | 373 | flush_icache_range(text_addr, text_addr+ex.a_text+ex.a_data); |
374 | 374 | } else { |
375 | - static unsigned long error_time, error_time2; | |
376 | 375 | if ((ex.a_text & 0xfff || ex.a_data & 0xfff) && |
377 | - (N_MAGIC(ex) != NMAGIC) && (jiffies-error_time2) > 5*HZ) | |
376 | + (N_MAGIC(ex) != NMAGIC) && printk_ratelimit()) | |
378 | 377 | { |
379 | 378 | printk(KERN_NOTICE "executable not page aligned\n"); |
380 | - error_time2 = jiffies; | |
381 | 379 | } |
382 | 380 | |
383 | - if ((fd_offset & ~PAGE_MASK) != 0 && | |
384 | - (jiffies-error_time) > 5*HZ) | |
381 | + if ((fd_offset & ~PAGE_MASK) != 0 && printk_ratelimit()) | |
385 | 382 | { |
386 | 383 | printk(KERN_WARNING |
387 | 384 | "fd_offset is not page aligned. Please convert program: %s\n", |
388 | 385 | bprm->file->f_path.dentry->d_name.name); |
389 | - error_time = jiffies; | |
390 | 386 | } |
391 | 387 | |
392 | 388 | if (!bprm->file->f_op->mmap||((fd_offset & ~PAGE_MASK) != 0)) { |
393 | 389 | |
394 | 390 | |
... | ... | @@ -495,15 +491,13 @@ |
495 | 491 | start_addr = ex.a_entry & 0xfffff000; |
496 | 492 | |
497 | 493 | if ((N_TXTOFF(ex) & ~PAGE_MASK) != 0) { |
498 | - static unsigned long error_time; | |
499 | 494 | loff_t pos = N_TXTOFF(ex); |
500 | 495 | |
501 | - if ((jiffies-error_time) > 5*HZ) | |
496 | + if (printk_ratelimit()) | |
502 | 497 | { |
503 | 498 | printk(KERN_WARNING |
504 | 499 | "N_TXTOFF is not page aligned. Please convert library: %s\n", |
505 | 500 | file->f_path.dentry->d_name.name); |
506 | - error_time = jiffies; | |
507 | 501 | } |
508 | 502 | down_write(¤t->mm->mmap_sem); |
509 | 503 | do_brk(start_addr, ex.a_text + ex.a_data + ex.a_bss); |