mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] some more fixes for inode.c
@ 2004-01-20 13:06 Rik van Riel
  2004-01-20 13:46 ` David Woodhouse
  2004-01-30  3:55 ` Rusty Russell
  0 siblings, 2 replies; 4+ messages in thread
From: Rik van Riel @ 2004-01-20 13:06 UTC (permalink / raw)
  To: Marcelo Tosatti; +Cc: David Woodhouse, linux-kernel

Hi Marcelo, David, 

when looking over the 2.4.25-pre6-rmap patch, I found two more
chunks in inode.c that might be needed/useful.  

The first chunk refiles the inode on the inode_unused_pagecache
list if needed, but I'm not 100% sure we need that change, since
maybe only completely unused inodes can end up here. David ?
It should be safe, though.

The second chunk make ssure to also remove the quota stuff for
inodes on the inode_unused_pagecache list, in the same way it
acts the other lists.


diff -Nru a/fs/inode.c b/fs/inode.c
--- a/fs/inode.c	Mon Jan 19 20:44:17 2004
+++ b/fs/inode.c	Mon Jan 19 20:44:17 2004
@@ -1234,10 +1235,8 @@
 				BUG();
 		} else {
 			if (!list_empty(&inode->i_hash)) {
-				if (!(inode->i_state & (I_DIRTY|I_LOCK))) {
-					list_del(&inode->i_list);
-					list_add(&inode->i_list, &inode_unused);
-				}
+				if (!(inode->i_state & (I_DIRTY|I_LOCK))) 
+					__refile_inode(inode);
 				inodes_stat.nr_unused++;
 				spin_unlock(&inode_lock);
 				if (!sb || (sb->s_flags & MS_ACTIVE))
@@ -1414,6 +1413,11 @@
 			remove_inode_dquot_ref(inode, type, &tofree_head);
 	}
 	list_for_each(act_head, &inode_unused) {
+		inode = list_entry(act_head, struct inode, i_list);
+		if (inode->i_sb == sb && IS_QUOTAINIT(inode))
+			remove_inode_dquot_ref(inode, type, &tofree_head);
+	}
+	list_for_each(act_head, &inode_unused_pagecache) {
 		inode = list_entry(act_head, struct inode, i_list);
 		if (inode->i_sb == sb && IS_QUOTAINIT(inode))
 			remove_inode_dquot_ref(inode, type, &tofree_head);


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] some more fixes for inode.c
  2004-01-20 13:06 [PATCH] some more fixes for inode.c Rik van Riel
@ 2004-01-20 13:46 ` David Woodhouse
  2004-01-20 13:52   ` Rik van Riel
  2004-01-30  3:55 ` Rusty Russell
  1 sibling, 1 reply; 4+ messages in thread
From: David Woodhouse @ 2004-01-20 13:46 UTC (permalink / raw)
  To: Rik van Riel; +Cc: Marcelo Tosatti, linux-kernel

On Tue, 2004-01-20 at 08:06 -0500, Rik van Riel wrote:
> The first chunk refiles the inode on the inode_unused_pagecache
> list if needed, 

Looks sane.

> but I'm not 100% sure we need that change, since
> maybe only completely unused inodes can end up here. David ?

No, I don't see any reason why that should be the case; you can get
iput() called for an inode which happens to have data in the page cache.
This part of the patch is needed.

-- 
dwmw2


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] some more fixes for inode.c
  2004-01-20 13:46 ` David Woodhouse
@ 2004-01-20 13:52   ` Rik van Riel
  0 siblings, 0 replies; 4+ messages in thread
From: Rik van Riel @ 2004-01-20 13:52 UTC (permalink / raw)
  To: David Woodhouse; +Cc: Marcelo Tosatti, linux-kernel

On Tue, 20 Jan 2004, David Woodhouse wrote:
> On Tue, 2004-01-20 at 08:06 -0500, Rik van Riel wrote:

> > but I'm not 100% sure we need that change, since
> > maybe only completely unused inodes can end up here. David ?
> 
> No, I don't see any reason why that should be the case; you can get
> iput() called for an inode which happens to have data in the page cache.
> This part of the patch is needed.

OK, thanks for confirming my suspicions.

Marcelo, could you please apply the patch ?

-- 
"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it." - Brian W. Kernighan


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] some more fixes for inode.c
  2004-01-20 13:06 [PATCH] some more fixes for inode.c Rik van Riel
  2004-01-20 13:46 ` David Woodhouse
@ 2004-01-30  3:55 ` Rusty Russell
  1 sibling, 0 replies; 4+ messages in thread
From: Rusty Russell @ 2004-01-30  3:55 UTC (permalink / raw)
  To: Rik van Riel; +Cc: Marcelo Tosatti, David Woodhouse, linux-kernel

In message <Pine.LNX.4.44.0401200803150.15071-100000@chimarrao.boston.redhat.com> you write:
>  	}
>  	list_for_each(act_head, &inode_unused) {
> +		inode = list_entry(act_head, struct inode, i_list);
> +		if (inode->i_sb == sb && IS_QUOTAINIT(inode))
> +			remove_inode_dquot_ref(inode, type, &tofree_head);
> +	}
> +	list_for_each(act_head, &inode_unused_pagecache) {
>  		inode = list_entry(act_head, struct inode, i_list);

list_for_each_entry() perhaps?

It's in 2.4, as well.

Cheers,
Rusty.
--
  Anyone who quotes me in their sig is an idiot. -- Rusty Russell.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-01-30  4:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-01-20 13:06 [PATCH] some more fixes for inode.c Rik van Riel
2004-01-20 13:46 ` David Woodhouse
2004-01-20 13:52   ` Rik van Riel
2004-01-30  3:55 ` Rusty Russell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®