* [PATCH] fs/binfmt_aout.c: Use printk_ratelimit()
[not found] ` <1205746593-24820-9-git-send-email-caglar-caicS1wCkhO6A22drWdTBw@public.gmane.org>
@ 2008-03-17 9:36 ` S.Çağlar Onur
2008-03-17 9:36 ` S.Çağlar Onur
0 siblings, 1 reply; 2+ messages in thread
From: S.Çağlar Onur @ 2008-03-17 9:36 UTC (permalink / raw)
To: linux-kernel-u79uwXL29TY76Z2rM5mHXA
Cc: linux-arch-u79uwXL29TY76Z2rM5mHXA, Andrew Morton,
Geert Uytterhoeven
Use printk_ratelimit() instead of jiffies based arithmetic, suggested by Geert Uytterhoeven
Cc: linux-arch-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: Andrew Morton <akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>
Cc: Geert Uytterhoeven <geert-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.org>
Signed-off-by: S.Çağlar Onur <caglar-caicS1wCkhO6A22drWdTBw@public.gmane.org>
---
fs/binfmt_aout.c | 12 +++---------
1 files changed, 3 insertions(+), 9 deletions(-)
diff --git a/fs/binfmt_aout.c b/fs/binfmt_aout.c
index a1bb224..ba4cddb 100644
--- a/fs/binfmt_aout.c
+++ b/fs/binfmt_aout.c
@@ -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);
} else {
- static unsigned long error_time, error_time2;
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");
- error_time2 = jiffies;
}
- if ((fd_offset & ~PAGE_MASK) != 0 &&
- (jiffies-error_time) > 5*HZ)
+ if ((fd_offset & ~PAGE_MASK) != 0 && printk_ratelimit())
{
printk(KERN_WARNING
"fd_offset is not page aligned. Please convert program: %s\n",
bprm->file->f_path.dentry->d_name.name);
- error_time = jiffies;
}
if (!bprm->file->f_op->mmap||((fd_offset & ~PAGE_MASK) != 0)) {
@@ -495,15 +491,13 @@ static int load_aout_library(struct file *file)
start_addr = ex.a_entry & 0xfffff000;
if ((N_TXTOFF(ex) & ~PAGE_MASK) != 0) {
- static unsigned long error_time;
loff_t pos = N_TXTOFF(ex);
- if ((jiffies-error_time) > 5*HZ)
+ if (printk_ratelimit())
{
printk(KERN_WARNING
"N_TXTOFF is not page aligned. Please convert library: %s\n",
file->f_path.dentry->d_name.name);
- error_time = jiffies;
}
down_write(¤t->mm->mmap_sem);
do_brk(start_addr, ex.a_text + ex.a_data + ex.a_bss);
--
1.5.4.3
--
To unsubscribe from this list: send the line "unsubscribe linux-arch" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [PATCH] fs/binfmt_aout.c: Use printk_ratelimit()
2008-03-17 9:36 ` [PATCH] fs/binfmt_aout.c: Use printk_ratelimit() S.Çağlar Onur
@ 2008-03-17 9:36 ` S.Çağlar Onur
0 siblings, 0 replies; 2+ messages in thread
From: S.Çağlar Onur @ 2008-03-17 9:36 UTC (permalink / raw)
To: linux-kernel; +Cc: linux-arch, Andrew Morton, Geert Uytterhoeven
Use printk_ratelimit() instead of jiffies based arithmetic, suggested by Geert Uytterhoeven
Cc: linux-arch@vger.kernel.org
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: S.Çağlar Onur <caglar@pardus.org.tr>
---
fs/binfmt_aout.c | 12 +++---------
1 files changed, 3 insertions(+), 9 deletions(-)
diff --git a/fs/binfmt_aout.c b/fs/binfmt_aout.c
index a1bb224..ba4cddb 100644
--- a/fs/binfmt_aout.c
+++ b/fs/binfmt_aout.c
@@ -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);
} else {
- static unsigned long error_time, error_time2;
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");
- error_time2 = jiffies;
}
- if ((fd_offset & ~PAGE_MASK) != 0 &&
- (jiffies-error_time) > 5*HZ)
+ if ((fd_offset & ~PAGE_MASK) != 0 && printk_ratelimit())
{
printk(KERN_WARNING
"fd_offset is not page aligned. Please convert program: %s\n",
bprm->file->f_path.dentry->d_name.name);
- error_time = jiffies;
}
if (!bprm->file->f_op->mmap||((fd_offset & ~PAGE_MASK) != 0)) {
@@ -495,15 +491,13 @@ static int load_aout_library(struct file *file)
start_addr = ex.a_entry & 0xfffff000;
if ((N_TXTOFF(ex) & ~PAGE_MASK) != 0) {
- static unsigned long error_time;
loff_t pos = N_TXTOFF(ex);
- if ((jiffies-error_time) > 5*HZ)
+ if (printk_ratelimit())
{
printk(KERN_WARNING
"N_TXTOFF is not page aligned. Please convert library: %s\n",
file->f_path.dentry->d_name.name);
- error_time = jiffies;
}
down_write(¤t->mm->mmap_sem);
do_brk(start_addr, ex.a_text + ex.a_data + ex.a_bss);
--
1.5.4.3
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-03-17 9:37 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <1205746593-24820-1-git-send-email-caglar@pardus.org.tr>
[not found] ` <1205746593-24820-2-git-send-email-caglar@pardus.org.tr>
[not found] ` <1205746593-24820-3-git-send-email-caglar@pardus.org.tr>
[not found] ` <1205746593-24820-4-git-send-email-caglar@pardus.org.tr>
[not found] ` <1205746593-24820-5-git-send-email-caglar@pardus.org.tr>
[not found] ` <1205746593-24820-6-git-send-email-caglar@pardus.org.tr>
[not found] ` <1205746593-24820-7-git-send-email-caglar@pardus.org.tr>
[not found] ` <1205746593-24820-8-git-send-email-caglar@pardus.org.tr>
[not found] ` <1205746593-24820-9-git-send-email-caglar@pardus.org.tr>
[not found] ` <1205746593-24820-9-git-send-email-caglar-caicS1wCkhO6A22drWdTBw@public.gmane.org>
2008-03-17 9:36 ` [PATCH] fs/binfmt_aout.c: Use printk_ratelimit() S.Çağlar Onur
2008-03-17 9:36 ` S.Çağlar Onur
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox