Re: [PATCH] mm: Fix dirty_bytes/dirty_background_bytes sysctls on64bit arches

From: David Rientjes
Date: Sun Feb 01 2009 - 19:32:21 EST


On Sun, 1 Feb 2009, Sven Wegener wrote:

> We need to pass an unsigned long as the minimum, because it gets casted
> to an unsigned long in the sysctl handler. If we pass an int, we'll
> access four more bytes on 64bit arches, resulting in a random minimum
> value.
>
> Signed-off-by: Sven Wegener <sven.wegener@xxxxxxxxxxx>

Acked-by: David Rientjes <rientjes@xxxxxxxxxx>


You'll also need the following since vm_dirty_bytes is declared as an
unsigned long. Andrew, can you queue Sven's fix for rc4 with this folded
into it?

Signed-off-by: David Rientjes <rientjes@xxxxxxxxxx>
---
mm/page-writeback.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/mm/page-writeback.c b/mm/page-writeback.c
--- a/mm/page-writeback.c
+++ b/mm/page-writeback.c
@@ -209,7 +209,7 @@ int dirty_bytes_handler(struct ctl_table *table, int write,
struct file *filp, void __user *buffer, size_t *lenp,
loff_t *ppos)
{
- int old_bytes = vm_dirty_bytes;
+ unsigned long old_bytes = vm_dirty_bytes;
int ret;

ret = proc_doulongvec_minmax(table, write, filp, buffer, lenp, ppos);
--
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/