[<prev] [next>] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.64.0704191733290.25796@sbz-30.cs.Helsinki.FI>
Date:	Thu, 19 Apr 2007 17:34:11 +0300 (EEST)
From:	Pekka J Enberg <penberg@...helsinki.fi>
To:	akpm@...ux-foundation.org
cc:	linux-kernel@...r.kernel.org
Subject: [PATCH] revoke: only fput unused files
From: Pekka Enberg <penberg@...helsinki.fi>
We should do fput only to files that were not used by the revoke
operation.
Signed-off-by: Pekka Enberg <penberg@...helsinki.fi>
---
 fs/revoke.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
Index: uml-2.6/fs/revoke.c
===================================================================
--- uml-2.6.orig/fs/revoke.c	2007-04-19 17:27:11.000000000 +0300
+++ uml-2.6/fs/revoke.c	2007-04-19 17:27:40.000000000 +0300
@@ -130,7 +130,6 @@ 	for (fd = 0; fd < fdt->max_fds; fd++) {
 		}
 
 		new_filp = revoke_table_get(table);
-		get_file(new_filp);
 
 		/*
 		 * Replace original struct file pointer with a pointer to
@@ -487,7 +486,7 @@ static void free_revoke_table(struct rev
 {
 	int i;
 
-	for (i = 0; i < table->size; i++)
+	for (i = table->end; i < table->size; i++)
 		fput(table->files[i]);
 
 	kfree(table->files);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
Powered by blists - more mailing lists
 
