Re: [patch] fixed 2.2.1 inode-leakage due bogus design of the free_inodes algorithm [was [Re: [shows

Andrea Arcangeli (andrea@e-mind.com)
Thu, 4 Feb 1999 15:30:38 +0100 (CET)


On Thu, 4 Feb 1999, Andrea Arcangeli wrote:

> Here the fix against 2.2.1:

Woops due lack of time last night I didn't looked at the whole algorithm
but I only removed the depth thing.

Could you try this patch. I don't have time to try it now (I should not
writing this now too ;):

Index: inode.c
===================================================================
RCS file: /var/cvs/linux/fs/inode.c,v
retrieving revision 1.1.1.2
diff -u -r1.1.1.2 inode.c
--- inode.c 1999/01/26 18:30:24 1.1.1.2
+++ linux/fs/inode.c 1999/02/04 14:26:04
@@ -329,11 +329,11 @@

static int free_inodes(int goal)
{
- struct list_head *tmp, *head = &inode_in_use;
+ struct list_head *head = &inode_in_use, *tmp = head;
LIST_HEAD(freeable);
- int found = 0, depth = goal << 1;
+ int found = 0;

- while ((tmp = head->prev) != head && depth--) {
+ while ((tmp = tmp->prev) != head) {
struct inode * inode = list_entry(tmp, struct inode, i_list);
list_del(tmp);
if (CAN_UNUSE(inode)) {

better that you backup your machine before trying it, since I had only two
seconds to think about it. I think as worse you should lockup again but...

Andrea Arcangeli

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/