Messages in this thread Patch in this message | | | Date | Sun, 1 Feb 2009 16:26:55 -0800 (PST) | From | David Rientjes <> | Subject | Re: [PATCH] mm: Fix dirty_bytes/dirty_background_bytes sysctls on 64bit arches |
| |
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@stealer.net>
Acked-by: David Rientjes <rientjes@google.com>
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@google.com> --- 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);
| |