提交 2e50b6cc 编写于 作者: S S.Caglar Onur 提交者: Linus Torvalds

fs/binfmt_aout.c: use printk_ratelimit()

Use printk_ratelimit() instead of jiffies based arithmetic, suggested by Geert
Uytterhoeven
Signed-off-by: NS.Caglar Onur <caglar@pardus.org.tr>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 aab3c3b0
...@@ -372,21 +372,17 @@ static int load_aout_binary(struct linux_binprm * bprm, struct pt_regs * regs) ...@@ -372,21 +372,17 @@ static int load_aout_binary(struct linux_binprm * bprm, struct pt_regs * regs)
flush_icache_range(text_addr, text_addr+ex.a_text+ex.a_data); flush_icache_range(text_addr, text_addr+ex.a_text+ex.a_data);
} else { } else {
static unsigned long error_time, error_time2;
if ((ex.a_text & 0xfff || ex.a_data & 0xfff) && if ((ex.a_text & 0xfff || ex.a_data & 0xfff) &&
(N_MAGIC(ex) != NMAGIC) && (jiffies-error_time2) > 5*HZ) (N_MAGIC(ex) != NMAGIC) && printk_ratelimit())
{ {
printk(KERN_NOTICE "executable not page aligned\n"); printk(KERN_NOTICE "executable not page aligned\n");
error_time2 = jiffies;
} }
if ((fd_offset & ~PAGE_MASK) != 0 && if ((fd_offset & ~PAGE_MASK) != 0 && printk_ratelimit())
(jiffies-error_time) > 5*HZ)
{ {
printk(KERN_WARNING printk(KERN_WARNING
"fd_offset is not page aligned. Please convert program: %s\n", "fd_offset is not page aligned. Please convert program: %s\n",
bprm->file->f_path.dentry->d_name.name); bprm->file->f_path.dentry->d_name.name);
error_time = jiffies;
} }
if (!bprm->file->f_op->mmap||((fd_offset & ~PAGE_MASK) != 0)) { if (!bprm->file->f_op->mmap||((fd_offset & ~PAGE_MASK) != 0)) {
...@@ -495,15 +491,13 @@ static int load_aout_library(struct file *file) ...@@ -495,15 +491,13 @@ static int load_aout_library(struct file *file)
start_addr = ex.a_entry & 0xfffff000; start_addr = ex.a_entry & 0xfffff000;
if ((N_TXTOFF(ex) & ~PAGE_MASK) != 0) { if ((N_TXTOFF(ex) & ~PAGE_MASK) != 0) {
static unsigned long error_time;
loff_t pos = N_TXTOFF(ex); loff_t pos = N_TXTOFF(ex);
if ((jiffies-error_time) > 5*HZ) if (printk_ratelimit())
{ {
printk(KERN_WARNING printk(KERN_WARNING
"N_TXTOFF is not page aligned. Please convert library: %s\n", "N_TXTOFF is not page aligned. Please convert library: %s\n",
file->f_path.dentry->d_name.name); file->f_path.dentry->d_name.name);
error_time = jiffies;
} }
down_write(&current->mm->mmap_sem); down_write(&current->mm->mmap_sem);
do_brk(start_addr, ex.a_text + ex.a_data + ex.a_bss); do_brk(start_addr, ex.a_text + ex.a_data + ex.a_bss);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册