Re: [PATCH] remove_arg_zero() rewrite

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Andrew Morton <akpm@...>
Cc: Petr <ptesarik@...>, Linux Kernel Mailing List <linux-kernel@...>, Nick Piggin <nickpiggin@...>
Date: Wednesday, March 7, 2007 - 6:55 pm

On Wed, 2007-03-07 at 14:41 -0800, Andrew Morton wrote:

Darn, must've fell off of lkml... or I missed it catching up my 4000+
email backlog.


Ah, but now I finally see the initial problem.

My patch is bug compatible and doesn't free the head page when that
becomes unused.

This should do on top:

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
---

Index: linux-2.6/fs/exec.c
===================================================================
--- linux-2.6.orig/fs/exec.c	2007-03-07 23:51:31.000000000 +0100
+++ linux-2.6/fs/exec.c	2007-03-07 23:50:41.000000000 +0100
@@ -1011,6 +1011,11 @@ void remove_arg_zero(struct linux_binprm
 			;
 
 		kunmap_atomic(kaddr, KM_USER0);
+
+		if (offset == PAGE_SIZE) {
+			__free_page(page);
+			bprm->page[(bprm->p >> PAGE_SHIFT) - 1] = NULL;
+		}
 	} while (offset == PAGE_SIZE);
 
 	bprm->p++;




-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] free pages in remove_arg_zero(), Petr , (Tue Feb 20, 9:29 am)
Re: [PATCH] free pages in remove_arg_zero(), Andrew Morton, (Wed Feb 21, 7:41 pm)
[PATCH] remove_arg_zero() rewrite, Peter Zijlstra, (Wed Mar 7, 6:09 pm)
Re: [PATCH] remove_arg_zero() rewrite, Andrew Morton, (Wed Mar 7, 6:41 pm)
Re: [PATCH] remove_arg_zero() rewrite, Peter Zijlstra, (Wed Mar 7, 6:55 pm)
Re: [PATCH] remove_arg_zero() rewrite, Randy Dunlap, (Wed Mar 7, 7:05 pm)